On 7/17/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Hello, everybody
I'm using a SQL clause to get data from the DB, and I need to use "computed"
fields to get the value of other fields. A (stupid) example of what I need is this:
SELECT IDContractLevel, IDContractLevel > 4 as IAmBoss, (SELECT * FROM Bosses
WHERE Flag = IAmBoss) FROM Employees;
What I get is an error indicating:
"SQLite error 1 - no such column: IAmBoss"
Could you post the definition of the table Employees?
I wasn't sure if you could put boolean expressions in the select
but it appears to work fine:
SQLite version 3.0.8
Enter ".help" for instructions
sqlite> select 1>4;
0
sqlite> select 6>4;
1
sqlite>
sub selects seem to work fine:
sqlite> select (select 2);
2
sqlite>
I suspect you really want something like this?
SELECT *
from Employees
where IDContractLevel > 4
;
--
SqliteImporter and SqliteReplicator: Command line utilities for Sqlite
http://www.reddawn.net/~jsprenkl/Sqlite
Cthulhu Bucks!
http://www.cthulhubucks.com