Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Is there any function availabe in DB2 to perform the same

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Is there any function availabe in DB2 to perform the same
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Feb 12, 2010 11:03 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts Strange EXEC function call in z/VM Willy Jensen CLIST & REXX 3 Wed Oct 05, 2016 2:07 pm
No new posts Replace function abdulrafi COBOL Programming 13 Mon Sep 12, 2016 10:12 am
No new posts Which function does the Ampersand (&a... Andi1982 PL/I & Assembler 3 Wed Aug 24, 2016 2:05 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us