Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this question
1  
Move your FROM clause before your WHERE clause: SELECT ... FROM ... WHERE ... –  kyle 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? –  Nigel Law Jan 14 '13 at 16:42
add comment

1 Answer

up vote 3 down vote accepted

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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