0

Using the QSpatiaLite plugin in QGIS I composed the following query

SELECT 'AddressPoint_2'.'buildingNu', 'AddressPoint_2'.'postCode' WHERE 'AddressPoint_2'.'postCode' = 'NR13 3AA' FROM 'AddressPoint_2'

This returns an error:

"The SQL query seems to be invalid near "FROM":syntax error."

A previous query:

SELECT 'AddressPoint_2'.'buildingNu', 'AddressPoint_2'.'postCode' FROM 'AddressPoint_2'

runs OK. I cannot see why the slightly more complicated query is failing on the same use of FROM

Any pointers please?

  • 1
    Move your FROM clause before your WHERE clause: SELECT ... FROM ... WHERE ... – user10353 Jan 14 '13 at 16:38
  • @kyle: Thank you for that. Changing the order as you suggested is the answer. Would you like to post that as the answer? – nigellaw Jan 14 '13 at 16:42
3

Move your FROM clause before your WHERE clause: SELECT ... FROM ... WHERE ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.