View previous topic :: View next topic
|
Author |
Message |
jose.jeyan
New User
Joined: 28 Jul 2006 Posts: 60 Location: Mumbai
|
|
|
|
Hi All,
i have a table with data as given below
Code: |
table1
key1 Value1 Value2 Value3
1 0 0 s
2 s 0 0
3 0 s 0
4 s s 0
5 - s s |
I need to retreive the data from the above table which has the same value in value1,value2,value3 .
I can do the same using a union or using (and or). Is there any function availabe in DB2 to perform the same.
Thanks in advance,
Tony Jose. |
|
Back to top |
|
|
Srihari Gonugunta
Active User
Joined: 14 Sep 2007 Posts: 295 Location: Singapore
|
|
|
|
Jose,
Have you tried this?
Code: |
select * from table1 where value1=value2 and value2=value3; |
Pleas let us know if you are looking for something else. |
|
Back to top |
|
|
jose.jeyan
New User
Joined: 28 Jul 2006 Posts: 60 Location: Mumbai
|
|
|
|
Hi Srihari,
Thanks for the information..
But i dont need to perform using value1= value2 .. is it possible by any function Like distinct ( where distinct used to select distinct rows from a table )
By any function |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Why would you mention distinct? Your request has nothing to do with distinct that i can see. . .
Why do you believe you want some "function" rather than a simple equal?
Quote: |
But i dont need to perform using value1= value2 .. |
If you have explained what you want the query to return, this is exactly what you want.
Or, you need to provide clarification. |
|
Back to top |
|
|
|