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?

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

1 Answer 1

3

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

answered Jan 14, 2013 at 16:52

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.