0

Can someone please help me with this version compatibility issue... The following code is working absolutely perfect on localhost server details here... Click here for Image of Localhost server Info MariaDB 10.4

DELETE FROM de_raw_data 
    WHERE 
        id IN (
        SELECT 
            id 
        FROM (
            SELECT 
                id,
                ROW_NUMBER() OVER (
                    PARTITION BY  category,parts,price,brand,make,model,year,engine,fuel
                    ORDER BY  category,parts,price,brand,make,model,year,engine,fuel
                ) AS row_num
            FROM 
                de_raw_data
            WHERE file_id = 197

        ) t
        WHERE row_num > 1
    )

But it gives error on GoDaddy shared hosting server... Click here for Server Info MySql 5.6

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(
                    PARTITION BY  category,parts,price,brand,ma' at line 9

I can't find any solution for this issue...

  • Should I replace this query which is compatible with MySql 5.6?
  • What will be that query?
  • And if I replace this query, will that be a proper solution?
Sami Khan
  • 1
  • 6
  • 2
    ROWNUMBER doesn't exist in mysql lower than 8.x. – nbk Jan 22 '20 at 19:18
  • So what should I do now? Any recommendation? Or query to replace ROWNUMBER which is compatible for MySQL 5.6? – Sami Khan Jan 22 '20 at 19:47
  • See the link in the duplicate error, you have to "build" it with session variables – nbk Jan 22 '20 at 19:52
  • The whole concept of OVER/PARTITION BY window functions does not exist in MySQL 5.6, so you'd have to replace more than just that one function call. Also MySQL 5.6 has already reached its end of life (EOL) almost two years ago in Feb 2018. Looks as if it is rather time to upgrade the shared hoster instance? – Hartmut Holzgraefe Jan 23 '20 at 08:52
  • Thanks @nbk that was really helpfull...@Hartmut Holzgraefe I also wanted to upgrade shared hosting from godaddy to AWS servers... But I dont have much server knowledge... I am confused which EC2 instance would be better!!! – Sami Khan Jan 23 '20 at 13:32

0 Answers0