IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Is there any function availabe in DB2 to perform the same


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jose.jeyan

New User


Joined: 28 Jul 2006
Posts: 60
Location: Mumbai

PostPosted: Fri Feb 12, 2010 5:50 pm
Reply with quote

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
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Fri Feb 12, 2010 6:06 pm
Reply with quote

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
View user's profile Send private message
jose.jeyan

New User


Joined: 28 Jul 2006
Posts: 60
Location: Mumbai

PostPosted: Fri Feb 12, 2010 8:42 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Feb 12, 2010 11:03 pm
Reply with quote

Hello,

Why would you mention distinct? Your request has nothing to do with distinct that i can see. . . icon_confused.gif

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Calling an Open C library function in... CICS 1
No new posts DATE2 function SYNCSORT 15
No new posts Use of Perform Thru Exit COBOL Programming 6
No new posts Help on PL/I jsonPutValue function PL/I & Assembler 8
No new posts how to use Tso outtrap external function All Other Mainframe Topics 8
Search our Forums:

Back to Top