Bob Arnott wrote:
Hello, I've got a query about how to get round a limitation of SQLite
(version 2.8.6) and inner selects. It's my understanding from what I've
read on the website and what I've tried on the command line that I can't
do:

SELECT *
  FROM TABLE_1, (SELECT COUNT(1)
                   FROM TABLE_2
                  WHERE TABLE_2.FK_ID=TABLE_1.ID)
 WHERE EFK_OWNER='boba';

As I can't reference the outer select from the inner one. Is there
another way of getting a count of things from another table and
appending it to a general select...?


SELECT * FROM table_1, (SELECT count(*) AS cnt, fk_id FROM table_2 GROUP BY fk_id) WHERE efk_owner='boba' AND fk_id=id;


-- D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565



Reply via email to