2009/3/18 Igor Tandetnik <itandet...@mvps.org>:
> Dermot <paik...@googlemail.com> wrote:
>> 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.
>
> What's the text of the error message?




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

This attempt give the error:

SQL error: near "=": syntax error

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

This return nothing, although it should. If I break the queries into 2
separate select statements they verify.

This is SQLite 3.5.1.

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

Reply via email to