Subject | Re: [firebird-support] Re: SQL statment Help |
---|---|
Author | Thomas Steinmaurer |
Post date | 2011-05-23T09:18:57Z |
> Nope as I have no clue as to how I use isql any advice on that would be niceHmm. Go into the <firebird>\bin directoy, then type isql.exe
> as well
In isql, connect to the database with:
CONNECT <yourdb> user <youruser> password <yourpwd>;
<yourstatement>;
Btw, for a test, I created the following table in a 2.1.4 database:
CREATE TABLE SALEHISTORY
(
ID INTEGER NOT NULL,
POSDESCRIPTION BLOB SUB_TYPE 1 SEGMENT SIZE 80,
TRADEDATE DATE,
QTYSOLD INTEGER,
CONSTRAINT PK_SALEHISTORY PRIMARY KEY (ID)
);
And then executed your statement:
SELECT
POSDESCRIPTION
, CASE WHEN (TradeDate = '2011/05/01') THEN COALESCE(QtySold, 0) ELSE
0 END as Col1
, CASE WHEN (TradeDate = '2011/05/02') THEN COALESCE(QtySold, 0) ELSE
0 END as Col2
, CASE WHEN (TradeDate = '2011/05/03') THEN COALESCE(QtySold, 0) ELSE
0 END as Col3
FROM (
SELECT
POSDESCRIPTION
, TradeDate
, SUM(QtySold) As QtySold
From
SALEHISTORY
Where
TradeDate Between '2011/04/01' AND '2011/04/04'
GROUP BY
1, 2
) as Sales
ORDER BY 1
Works fine. Perhaps your problem is ODBC-driver related. I would repost
in Firebird-odbc-devel.
--
With regards,
Thomas Steinmaurer
Upscene Productions
http://www.upscene.com
http://blog.upscene.com/thomas/
Download LogManager Series, FB TraceManager today!
Continuous Database Monitoring Solutions supporting
Firebird, InterBase, Advantage Database, MS SQL Server
and NexusDB!
> -----Original Message-----
> From: firebird-support@yahoogroups.com
> [mailto:firebird-support@yahoogroups.com] On Behalf Of Thomas Steinmaurer
> Sent: 23 May 2011 10:00 AM
> To: firebird-support@yahoogroups.com
> Subject: Re: [firebird-support] Re: SQL statment Help
>
>> Version 2.1.3.18185
>>
>> ODBC version 2.0.0.150
>
> And, have you tried running the statement in isql or an other
> non-ODBC-based tool?
>
>