Skip to content

Tag: mysql

Can’t remove duplicates from MariaDB 10

I’m having hard time removing duplicates from database. It’s MariaDB (protocol version: 10, 10.3.34-MariaDB Server). I need to remove rows where three columns are equal. I was trying to use WITH clause but database throws error that it can’t recognize ‘WITH’, so I focused on traditional way. I need to remove rows where foreignId, column1 and column2 are equal. I’m

DELETE entry that is older than current datetime in MySQL

I have tried the following among various other statements but thought one of these should obviously work but no luck so far. Please tell me what I’m doing wrong. Not getting an error, it’s just not working. DELETE FROM table_name WHERE from < NOW() DELETE FROM table_name WHERE from < ‘2022-04-16 08:00:00’ Example Answer You shouldn’t name your columns (or

Join same two tables multiple times in one query [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last month. Improve this question I have problem with my query and i can not figure it how to do it. What i want to do is to display “Ban By”

how to extract and zip values from json with SQL, mysql

I struggle to extract the required values from the JSON column in MySQL. Imagine the variable: and I need to extract and return a new JSON array containing only selected key-value pairs, eg.: only a’s and b’s and if the required key does not exist I want to return null for that key: thanks Answer Here’s a solution using MySQL

How merge these two sql queries in mysql?

I want to merge below two queries and display two count based on the condition of each band name but I am not getting any clue. Can anyone help me, please? Thanks Answer I mean I want to have two-column of count ids The requirements are not clear at all and I had originally typed a separate answer, but

SQL query with meta_key,meta_value and have 2 conditions

I am trying to do an SQL query to find a form id of the Registration form of the user on a wordpress site, because this form doesn’t have the id of the user yet, I have to find the user email which is unique and check if the gdprchekbox-1 is true because it is only used for the registering