I need help with syntax error in query

Discussion in 'Databases' started by Dick Raney, Sep 23, 2020.

  1. #1
    My query:
    DELETE FROM 014_terms WHERE term_id IN (SELECT term_id FROM 014_term_taxonomy WHERE taxonomy LIKE 'pa_%');

    Gets an error:
    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE term_id IN (SELECT term_id FROM 014_term_taxonomy WHERE taxonomy LIKE '...' at line 1

    Any ideas what is causing the error?
     
    Dick Raney, Sep 23, 2020 IP
  2. MayurKawale

    MayurKawale Well-Known Member

    Messages:
    221
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    170
    #2
    Generally the 1064 error displays any time you have an issue with your SQL syntax, and is often due to using reserved words, missing data in the database, or mistyped/obsolete commands.
    As per me query syntax do not have any problem. For crosscheck you can use the following websites & check the syntax error i.e
    1) https://www.piliapp.com/mysql-syntax-check/
    2) https://www.eversql.com/sql-syntax-check-validator/

    I would suggest to go SQL manual UI and check the query again.

    I hope it would help .. !!
     
    MayurKawale, Dec 2, 2020 IP
  3. Dick Raney

    Dick Raney Greenhorn

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #3
    Thanks, I got it fixed.
     
    Dick Raney, Dec 2, 2020 IP
  4. MayurKawale

    MayurKawale Well-Known Member

    Messages:
    221
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    170
    #4
    Great... let the world know what was the problem...
     
    MayurKawale, Dec 2, 2020 IP
    qwikad.com likes this.