View previous topic :: View next topic
|
Author |
Message |
ParagChouguley
Active User
Joined: 03 Feb 2007 Posts: 175 Location: PUNE(INDIA)
|
|
|
|
Hi ALL,
I have a DB2 table having few columns (Say Col1, Col2, Col3, Col4,......).
None of them is Primary key and all have duplicates allowed.
Table have several thousand rows.
Now I want to select only those rows having following combination values for first 3 columns.
Code: |
Col1 Col2 Col3
A B C
A Z M
Q F L
. . .
. . .
. . .
|
This data have say 50 rows.
Duplicates are allowed in my result set.
This has to be done thru SQL query which I will run thru SPUFI. ( and not thru COBOL program)
--Parag |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
ParagChouguley wrote: |
Hi ALL,
I have a DB2 table having few columns (Say Col1, Col2, Col3, Col4,......).
None of them is Primary key and all have duplicates allowed.
Table have several thousand rows.
Now I want to select only those rows having following combination values for first 3 columns.
Code: |
Col1 Col2 Col3
A B C
A Z M
Q F L
. . .
. . .
. . .
|
This data have say 50 rows.
Duplicates are allowed in my result set.
This has to be done thru SQL query which I will run thru SPUFI. ( and not thru COBOL program)
--Parag |
How about showing us what you have tried and the results! |
|
Back to top |
|
|
ParagChouguley
Active User
Joined: 03 Feb 2007 Posts: 175 Location: PUNE(INDIA)
|
|
|
|
I couldn't do this !
--Parag |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
ParagChouguley wrote: |
I couldn't do this !
--Parag |
Code: |
SELECT * FROM TABLE
WHERE (COL1 = 'A' AND COL2 = 'B' AND COL3 = 'C')
OR (COL1 = 'A' AND COL2 = 'Z' AND COL3 = 'M')
OR (COL1 = 'Q' AND COL2 = 'F' AND COL3 = 'L');
|
That is difficult. |
|
Back to top |
|
|
|