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

SELECT VALUE (A.COL1,B.COL1)


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

Active User


Joined: 08 Feb 2009
Posts: 116
Location: CHENNAI/NEW JERSEY - INDIA/USA

PostPosted: Thu Mar 24, 2011 6:02 pm
Reply with quote

Hi,

I am trying to use the value clause in DB2.

SELECT VALUE (A.COL1,B.COL1)
FROM TAB1 A, TAB2 B

The above query retruns all the values in A.COL1 and B.COL1.

Its not clear.

Can some one explain me.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Thu Mar 24, 2011 7:27 pm
Reply with quote

it should be perfectly clear if those smilies weren't so distracting.

Just read the manual.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Mar 24, 2011 8:10 pm
Reply with quote

1. you are only returning one column.

2. you are doing a join with out any where clause
so your result it a cartisian (can't spell),
but the number of rows you return is a factor of
number of rows in tab1 X (times) number of rows in tab2.

unless you have any null values for a.col1, you are always returning
a unique a.col1. times the number of rows in tab2.
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Fri Mar 25, 2011 4:41 am
Reply with quote

Dick - It's "cartesian."

I know you know it's named after Rene Descartes.

You also know he is known for "cogito, ergo sum" - "I think, therefore I am."

What you may not know, however, is that Descartes was out having lunch at the local sandwhich shoppe one day and ordered a hamburger. The waitress asked if he wanted fries with that, to which Descartes replied "I think not" - and he immediately disappeared.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Fri Mar 25, 2011 4:03 pm
Reply with quote

Phrzby Phil wrote:
Dick - It's "cartesian."

I know you know it's named after Rene Descartes.

You also know he is known for "cogito, ergo sum" - "I think, therefore I am."

Not just known for a bon mot, but a great mathematician and philosopher, ranked up there with Edsel "The Horse" Murphy. Some indeed rank him ahead of Murphy, but my own feeling is that one shouldn't put Descartes before the Horse.
Back to top
View user's profile Send private message
Elixir

Active User


Joined: 08 Feb 2009
Posts: 116
Location: CHENNAI/NEW JERSEY - INDIA/USA

PostPosted: Wed Apr 13, 2011 5:26 pm
Reply with quote

Hi dbzTHEdinosauer,

I tried searching manuals to find description of VALUE clause, could not find it.

Please suggest if you know some manuals on it.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Apr 13, 2011 5:51 pm
Reply with quote

look under 3.2.13 COALESCE
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 Dynamically pass table name to a sele... DB2 2
No new posts SELECT from data change table DB2 5
No new posts Select two different counts from SQL... DB2 6
No new posts Select a DB2 value in a specific deci... DB2 4
No new posts How can I select certain file dependi... JCL & VSAM 12
Search our Forums:

Back to Top