Lines Matching refs:FROM

16 # subqueries in their FROM clause.
48 SELECT DISTINCT y FROM t1 ORDER BY y;
53 execsql2 {SELECT * FROM (SELECT x, y FROM t1 WHERE x<2)}
56 execsql {SELECT count(*) FROM (SELECT y FROM t1)}
59 execsql {SELECT count(*) FROM (SELECT DISTINCT y FROM t1)}
62 execsql {SELECT count(*) FROM (SELECT DISTINCT * FROM (SELECT y FROM t1))}
65 execsql {SELECT count(*) FROM (SELECT * FROM (SELECT DISTINCT y FROM t1))}
71 FROM (SELECT count(*),y FROM t1 GROUP BY y) AS a,
72 (SELECT max(x),y FROM t1 GROUP BY y) as b
79 FROM (SELECT count(*),y FROM t1 GROUP BY y) AS a,
80 (SELECT max(x),y FROM t1 GROUP BY y) as b
87 FROM (SELECT count(*) as p , y as q FROM t1 GROUP BY y) AS a,
88 (SELECT max(x) as r, y as s FROM t1 GROUP BY y) as b
95 FROM (SELECT count(*) as p , y as q FROM t1 GROUP BY y) AS a,
96 (SELECT max(x) as r, y as s, min(x)+y FROM t1 GROUP BY y) as b
104 INSERT INTO t2 SELECT * FROM t1;
105 SELECT DISTINCT b FROM t2 ORDER BY b;
109 execsql2 {SELECT * FROM (SELECT a, b FROM t2 WHERE a<2)}
112 execsql {SELECT count(*) FROM (SELECT b FROM t2)}
115 execsql {SELECT count(*) FROM (SELECT DISTINCT b FROM t2)}
118 execsql {SELECT count(*) FROM (SELECT DISTINCT * FROM (SELECT b FROM t2))}
121 execsql {SELECT count(*) FROM (SELECT * FROM (SELECT DISTINCT b FROM t2))}
127 FROM (SELECT count(*),b FROM t2 GROUP BY b) AS a,
128 (SELECT max(a),b FROM t2 GROUP BY b) as b
135 FROM (SELECT count(*),b FROM t2 GROUP BY b) AS a,
136 (SELECT max(a),b FROM t2 GROUP BY b) as b
143 FROM (SELECT count(*) as p , b as q FROM t2 GROUP BY b) AS a,
144 (SELECT max(a) as r, b as s FROM t2 GROUP BY b) as b
151 FROM (SELECT count(*) as p , b as q FROM t2 GROUP BY q) AS a,
152 (SELECT max(a) as r, b as s FROM t2 GROUP BY s) as b
159 SELECT * FROM (SELECT * FROM (SELECT * FROM t1 WHERE x=3));
164 SELECT * FROM
166 FROM (SELECT count(*) as p , b as q FROM t2 GROUP BY q) AS a,
167 (SELECT max(a) as r, b as s FROM t2 GROUP BY s) as b
174 SELECT a,b,a+b FROM (SELECT avg(x) as 'a', avg(y) as 'b' FROM t1)
179 SELECT a,b,a+b FROM (SELECT avg(x) as 'a', avg(y) as 'b' FROM t1 WHERE y=4)
184 SELECT x,y,x+y FROM (SELECT avg(a) as 'x', avg(b) as 'y' FROM t2 WHERE a=4)
189 SELECT a,b,a+b FROM (SELECT avg(x) as 'a', avg(y) as 'b' FROM t1)
195 SELECT a,b,a+b FROM (SELECT avg(x) as 'a', avg(y) as 'b' FROM t1)
201 SELECT a,b,a+b FROM (SELECT avg(x) as 'a', avg(y) as 'b' FROM t1 WHERE y=4)
207 SELECT a,b,a+b FROM (SELECT avg(x) as 'a', avg(y) as 'b' FROM t1 WHERE y=4)
213 SELECT a,b,a+b FROM (SELECT avg(x) as 'a', y as 'b' FROM t1 GROUP BY b)
219 SELECT a,b,a+b FROM
220 (SELECT avg(x) as 'a', y as 'b' FROM t1 GROUP BY b)
226 SELECT a,b,a+b FROM
227 (SELECT avg(x) as 'a', y as 'b' FROM t1 GROUP BY b HAVING a>1)
233 SELECT a,b,a+b FROM
234 (SELECT avg(x) as 'a', y as 'b' FROM t1 GROUP BY b HAVING a>1)
240 SELECT [count(*)],y FROM (SELECT count(*), y FROM t1 GROUP BY y)
246 SELECT [count(*)],y FROM (SELECT count(*), y FROM t1 GROUP BY y)
253 SELECT a,b,c FROM
254 (SELECT x AS 'a', y AS 'b', x+y AS 'c' FROM t1 WHERE y=4)
260 SELECT y FROM (SELECT DISTINCT y FROM t1) WHERE y<5 ORDER BY y
265 SELECT DISTINCT y FROM (SELECT y FROM t1) WHERE y<5 ORDER BY y
270 SELECT avg(y) FROM (SELECT DISTINCT y FROM t1) WHERE y<5 ORDER BY y
275 SELECT avg(y) FROM (SELECT DISTINCT y FROM t1 WHERE y<5) ORDER BY y
281 SELECT a,x,b FROM
282 (SELECT x+3 AS 'a', x FROM t1 WHERE y=3) AS 'p',
283 (SELECT x AS 'b' FROM t1 WHERE y=4) AS 'q'
290 SELECT a,x,b FROM
291 (SELECT x+3 AS 'a', x FROM t1 WHERE y=3),
292 (SELECT x AS 'b' FROM t1 WHERE y=4)
302 DELETE FROM t1 WHERE x>4;
303 SELECT * FROM t1
308 SELECT * FROM (
309 SELECT x AS 'a' FROM t1 UNION ALL SELECT x+10 AS 'a' FROM t1
315 SELECT * FROM (
316 SELECT x AS 'a' FROM t1 UNION ALL SELECT x+1 AS 'a' FROM t1
322 SELECT * FROM (
323 SELECT x AS 'a' FROM t1 UNION SELECT x+1 AS 'a' FROM t1
329 SELECT * FROM (
330 SELECT x AS 'a' FROM t1 INTERSECT SELECT x+1 AS 'a' FROM t1
336 SELECT * FROM (
337 SELECT x AS 'a' FROM t1 EXCEPT SELECT x*2 AS 'a' FROM t1
342 # Subselects with no FROM clause
346 SELECT * FROM (SELECT 1)
351 SELECT c,b,a,* FROM (SELECT 1 AS 'a', 2 AS 'b', 'abc' AS 'c')
356 SELECT c,b,a,* FROM (SELECT 1 AS 'a', 2 AS 'b', 'abc' AS 'c' WHERE 0)
361 SELECT c,b,a,* FROM (SELECT 1 AS 'a', 2 AS 'b', 'abc' AS 'c' WHERE 1)
387 SELECT * FROM t3 NATURAL JOIN t4;
392 SELECT y, p, q, r FROM
393 (SELECT t1.y AS y, t2.b AS b FROM t1, t2 WHERE t1.x=t2.a) AS m,
394 (SELECT t3.p AS p, t3.q AS q, t4.r AS r FROM t3 NATURAL JOIN t4) as n
400 SELECT y, p, q, r FROM
401 (SELECT t1.y AS y, t2.b AS b FROM t1, t2 WHERE t1.x=t2.a) AS m,
402 (SELECT t3.p AS p, t3.q AS q, t4.r AS r FROM t3 NATURAL JOIN t4) as n
408 SELECT DISTINCT y, p, q, r FROM
409 (SELECT t1.y AS y, t2.b AS b FROM t1, t2 WHERE t1.x=t2.a) AS m,
410 (SELECT t3.p AS p, t3.q AS q, t4.r AS r FROM t3 NATURAL JOIN t4) as n
416 SELECT * FROM
417 (SELECT y, p, q, r FROM
418 (SELECT t1.y AS y, t2.b AS b FROM t1, t2 WHERE t1.x=t2.a) AS m,
419 (SELECT t3.p AS p, t3.q AS q, t4.r AS r FROM t3 NATURAL JOIN t4) as n
421 (SELECT r AS z FROM t4 WHERE q=11) AS f
427 SELECT * FROM
428 (SELECT y, p, q, r FROM
429 (SELECT t1.y AS y, t2.b AS b FROM t1, t2 WHERE t1.x=t2.a) AS m,
430 (SELECT t3.p AS p, t3.q AS q, t4.r AS r FROM t3 NATURAL JOIN t4) as n
432 (SELECT r AS z FROM t4 WHERE q=11) AS f