Subject | Re: [firebird-support] select from select |
---|---|
Author | Johannes Pretorius |
Post date | 2003-11-21T11:36:46Z |
Good day
\=\-==\-=\\-=
What do you want from the second table for instance if you want the codes
in T1 that is in T2 then you can use
select * from T1 where code in (select ref_code from T2)
else if you want to see the duplicates in the same table
select * from table1 t1 where (select count(code) from table1 t2 where
t1.code = t2.code) > 1
Otherwise please specify what you want out of the T1 table.
In short you can't use the inner select in the FROM clause needs to be in
the WHERE clause
(If still correct I come from Interbase 5.6)
Hope it helps
Johannes
At 10:52 21/11/2003 +0000, you wrote:
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.542 / Virus Database: 336 - Release Date: 18/11/2003
[Non-text portions of this message have been removed]
\=\-==\-=\\-=
What do you want from the second table for instance if you want the codes
in T1 that is in T2 then you can use
select * from T1 where code in (select ref_code from T2)
else if you want to see the duplicates in the same table
select * from table1 t1 where (select count(code) from table1 t2 where
t1.code = t2.code) > 1
Otherwise please specify what you want out of the T1 table.
In short you can't use the inner select in the FROM clause needs to be in
the WHERE clause
(If still correct I come from Interbase 5.6)
Hope it helps
Johannes
At 10:52 21/11/2003 +0000, you wrote:
>Hello to everyone,----------
>
>First of all, I am very delighted and impressed by Firebird.
>However, I encountered an issue which I couldn't solve.
>I need to do something like:
>
>SELECT * FROM ( SELECT * FROM T1 ) T2;
>
>(ok, this is a verry dummy sample, but basically this is what i need)
>For example, in IBExpert I get "invalid token" for the second select.
>
>The question is - am I missing something or this kind of construct is
>not (yet) possible in Firebird? (I am using now 1.5RC7)
>
>
>Kind regards,
>Stefan Koronka
>
>
>
>
>
>
>
>To unsubscribe from this group, send an email to:
>firebird-support-unsubscribe@yahoogroups.com
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.542 / Virus Database: 336 - Release Date: 18/11/2003
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.542 / Virus Database: 336 - Release Date: 18/11/2003
[Non-text portions of this message have been removed]