ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
I am woking on a ims-db2 migration pgm.
I am using the following query in my cursor
Select cols
From table
Where concat(key1,concat(key2,concat(key3,key4))) >= concat(:key1,concat(:key2,concat(:key3,:key4))) in pl1.
Can you plz suggest a better way so that I cud tune up my sql query.
thanks
ashish |
|
ovreddy
Active User
Joined: 06 Dec 2004 Posts: 211 Location: Keane Inc., Minneapolis USA.
|
|
|
|
Hi Ashish,
One way to combine more than two columns is you can use concatination operator ( || ) instead of CONCAT which is more compatible.
select cols from tab where col1 || col2 || col3 || col4 = :col1 || :col2 || :col3 || :col4;
Other wise you can create a function to do this...
Bye,
Reddy. |
|