Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 5 of 5 total |
Example with UNION |
Fri, Nov 16 2007 1:09 PM | Permanent Link |
Dieter Nagy | Hello,
with DBISAM work this fine: Select Z1 as ZValues into TotalTest from lotto union all Select Z2 as ZValues from lotto union all select Z3 as ZValues from lotto union all select Z4 as ZValues from lotto union all select Z5 as ZValues from lotto union all Select Z6 as Zvalues from lotto Order by ZValues ; select ZValues, count(Zvalues) as ZFreq from TotalTest group by Zvalues; select zvalues,count(zvalues) as zfreq into SU from totaltest group by zvalues; Please show me how can I do this with elevateDB 1.06. I can't find an example. TIA Dieter Nagy |
Fri, Nov 16 2007 5:43 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Dieter,
Do you want the SU result set to be returned from the script ? Also, what's with the second SQL SELECT ? It doesn't seem to do anything at all. -- Tim Young Elevate Software www.elevatesoft.com |
Fri, Nov 16 2007 11:44 PM | Permanent Link |
Dieter Nagy | Tim,
yes I want the SU result set returned from the script. Tahnks Dieter Nagy "Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote: Dieter, Do you want the SU result set to be returned from the script ? Also, what's with the second SQL SELECT ? It doesn't seem to do anything at all. -- Tim Young Elevate Software www.elevatesoft.com |
Mon, Nov 19 2007 3:10 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Dieter,
<< yes I want the SU result set returned from the script. >> Okay, use this: SCRIPT BEGIN DECLARE Result CURSOR WITH RETURN FOR Stmt; EXECUTE IMMEDIATE 'CREATE TEMPORARY TABLE TotalTest AS Select Z1 as ZValues from lotto union all Select Z2 as ZValues from lotto union all select Z3 as ZValues from lotto union all select Z4 as ZValues from lotto union all select Z5 as ZValues from lotto union all Select Z6 as Zvalues from lotto'; PREPARE Stmt FROM 'select zvalues,count(zvalues) as zfreq from totaltest group by zvalues'; OPEN Result; END Be sure to DROP the TotalTest temporary table after you're done with the result set. -- Tim Young Elevate Software www.elevatesoft.com |
Wed, Nov 21 2007 10:04 AM | Permanent Link |
Dieter Nagy | Thanks Tim
Dieter "Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote: Dieter, << yes I want the SU result set returned from the script. >> Okay, use this: SCRIPT BEGIN DECLARE Result CURSOR WITH RETURN FOR Stmt; EXECUTE IMMEDIATE 'CREATE TEMPORARY TABLE TotalTest AS Select Z1 as ZValues from lotto union all Select Z2 as ZValues from lotto union all select Z3 as ZValues from lotto union all select Z4 as ZValues from lotto union all select Z5 as ZValues from lotto union all Select Z6 as Zvalues from lotto'; PREPARE Stmt FROM 'select zvalues,count(zvalues) as zfreq from totaltest group by zvalues'; OPEN Result; END Be sure to DROP the TotalTest temporary table after you're done with the result set. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Tuesday, September 17, 2024 at 04:19 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |