Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 2 of 2 total |
Using left join with subquery |
Sat, Sep 19 2009 9:34 AM | Permanent Link |
Davis | Hi,
How can use subquery with dbisam ? The bellow code don't work. Thanks. select s.c_codcli, s.c_seqauto, qtd.qtdsessoes from sessoes s left join ( select c_codcli, c_seqauto, count(*) as qtdsessoes from sessoes group by c_codcli,c_seqauto ) qtd on (s.c_codcli=qtd.c_codcli and s.c_seqauto=qtd.c_seqauto) |
Mon, Sep 21 2009 4:51 AM | Permanent Link |
"John Hay" | Davi
> How can use subquery with dbisam ? The bellow code don't work. > Thanks. > > select > s.c_codcli, > s.c_seqauto, > > qtd.qtdsessoes > > from sessoes s > > left join > ( select c_codcli, c_seqauto, count(*) as qtdsessoes from sessoes group by > c_codcli,c_seqauto ) qtd > > on (s.c_codcli=qtd.c_codcli and s.c_seqauto=qtd.c_seqauto) DBISAM does not support subquery/derived tables. You can use a script like select c_codcli, c_seqauto, count(*) as qtdsessoes into memory\qtd from sessoes group by c_codcli,c_seqauto; select s.c_codcli,s.c_seqauto,qtd.qtdsessoes from sessoes s left join qtd on (s.c_codcli=qtd.c_codcli and s.c_seqauto=qtd.c_seqauto) John |
This web page was last updated on Saturday, May 4, 2024 at 12:54 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |