Subject | Select query |
---|---|
Author | Alfred Thomas |
Post date | 2003-12-18T15:00:42Z |
Hi
Can anyone please help me to figure out the following query.
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
);
I want to select all the different ProgramName's with a specific SystemID
and StatusCode.
This will return duplicate ProgramName's with different FileVersions. I want
the query to
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
Thanks for all the help
Regards
Alfred
Can anyone please help me to figure out the following query.
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
);
I want to select all the different ProgramName's with a specific SystemID
and StatusCode.
This will return duplicate ProgramName's with different FileVersions. I want
the query to
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
Thanks for all the help
Regards
Alfred