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?

2
  • 1
    Move your FROM clause before your WHERE clause: SELECT ... FROM ... WHERE ...
    – user10353
    Commented Jan 14, 2013 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
    Commented Jan 14, 2013 at 16:42

1 Answer 1

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 and acknowledge you have read our privacy policy.

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