🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #4730

SQL statement in Interbase

#4730
From: JEchavez
Date: Thu, 22 Nov 2001 07:24
30 lines
1744 bytes
I have two similar tables, one seated on SQL Server, and the other in
Interbase.
The lines of code that follow works perfectly well in SQL Server.

--------------
select max(High) AS HIGH, min(Low) AS LOW, max(TotalVolume) as HiVol,
min(TotalVolume)LowVol
from TB_Daily
where IssueID = 123 and year(TradedDte) = 1999
group by month(TradedDte)
--------------

I made an equivalent SQL statement in Interbase as follows:

--------------
select max(High) AS HIGH, min(Low) AS LOW, max(TotalVolume) as HiVol,
min(TotalVolume)LowVol
from TB_Daily
where IssueID = 123 and extract(year from TradedDte) = 1999
group by extract(month from TradedDte)
-------------

My problem is, I get an error in the Group By portion. What should I do
inorder to get the same results as delivered
through my SQL statement used in SQL Server, where it performs the aggregate
functions grouped by months???

Please help!!!

JEchavez
Technical Details
Message-ID: <3bfca7bd_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,fee932dd685cf1ec,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-11-21 23:46:20 PST
From: "JEchavez" <jechavez@idsfinance.com>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: SQL statement in Interbase
Date: Thu, 22 Nov 2001 15:24:11 +0800
Lines: 34
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
NNTP-Posting-Host: 65.211.198.6
Message-ID: <3bfca7bd_1@dnews>
X-Trace: dnews 1006413757 65.211.198.6 (21 Nov 2001 23:22:37 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews