24 lines
408 B
SQL
24 lines
408 B
SQL
# name: test/sql/subquery/table/test_aliasing.test
|
|
# description: Aliasing and aggregation in subqueries
|
|
# group: [table]
|
|
|
|
statement ok
|
|
PRAGMA enable_verification
|
|
|
|
statement ok
|
|
create table a(i integer)
|
|
|
|
statement ok
|
|
insert into a values (42)
|
|
|
|
query I
|
|
select * from (select i as j from a group by j) sq1 where j = 42
|
|
----
|
|
42
|
|
|
|
query I
|
|
select * from (select i as j from a group by i) sq1 where j = 42
|
|
----
|
|
42
|
|
|