SQLite treats double-quoted strings as column and table identifiers.  Use 
single-quotes for literals.

SELECT * FROM tbl1 WHERE description='someval' AND
foreign_key_id=(select id from tbl2 where name='Joe');

 -Clark



----- Original Message ----
From: Dermot <paik...@googlemail.com>
To: sqlite-users@sqlite.org
Sent: Wednesday, March 18, 2009 8:35:52 AM
Subject: [sqlite] Newbie question

Hi,

I am very green with SQL entirely so I apologise in advance for what
might be a simple query.

I want to do a select query a bit like this:

SELECT * FROM tbl1 WHERE description="someval" AND
foreign_key_id=(select id from tbl2 where name="Joe");

This gives me a syntax error and my other efforts are not yielding results.

I am not sure what the term is for such as statement, compound perhaps?

TIA,
Dp.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to