Subject | Re: [firebird-support] Select query |
---|---|
Author | Martijn Tonies |
Post date | 2003-12-18T15:22:06Z |
Hi Alfred,
those nasty delimited identifiers, just to start with :-)
Or find a setting saying something along the lines of "Uppercase
identifiers".
select programname, systemid, max(fileversion), statuscode
from ...
group by programname, systemid, statuscode
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com
> Can anyone please help me to figure out the following query.I suggest you get yourself a decent admin/dev tool and drop
> I have the following table
>
> CREATE TABLE PROGRAM (
> "ProgramID" INTEGER NOT NULL,
> "SystemID" SMALLINT NOT NULL,
> "ProgramName" VARCHAR(30),
> "CheckinTimeStamp" TIMESTAMP,
> "SourceDirectory" VARCHAR(150),
> "DeployDirectory" VARCHAR(150),
> "ProgramData" BLOB SUB_TYPE 0 SEGMENT SIZE 8192,
> "FileVersion" VARCHAR(20),
> "VersionComments" VARCHAR(100),
> "StatusCode" SMALLINT NOT NULL
> );
those nasty delimited identifiers, just to start with :-)
Or find a setting saying something along the lines of "Uppercase
identifiers".
> I want to select all the different ProgramName's with a specific SystemIDwant
> and StatusCode.
> This will return duplicate ProgramName's with different FileVersions. I
> the query toTry:
> select the largest or max FileVersion of each ProgramName like:
>
> Data:
> ProgramName SystemID FileVersion StatusCode
> ----------- -------- ----------- ----------
> Prog1 1 1.0.0.1 1
> Prog1 1 1.0.0.2 1
> Prog2 1 1.0.0.1 1
> Prog3 1 1.0.0.3 1
>
> Query output:
> ProgramName SystemID FileVersion StatusCode
> ----------- -------- ----------- ----------
> Prog1 1 1.0.0.2 1
> Prog2 1 1.0.0.1 1
> Prog3 1 1.0.0.3 1
select programname, systemid, max(fileversion), statuscode
from ...
group by programname, systemid, statuscode
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com