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
 

 

SELECT VALUE (A.COL1,B.COL1)

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: SELECT VALUE (A.COL1,B.COL1)
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    Post subject:
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: 6967
Location: porcelain throne

PostPosted: Thu Mar 24, 2011 8:10 pm    Post subject:
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

Active Member


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

PostPosted: Fri Mar 25, 2011 4:41 am    Post subject:
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: 1754
Location: Bloomington, IL

PostPosted: Fri Mar 25, 2011 4:03 pm    Post subject:
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    Post subject: SELECT VALUE (A.COL1,B.COL1)
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: 6967
Location: porcelain throne

PostPosted: Wed Apr 13, 2011 5:51 pm    Post subject:
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    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
No new posts Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm
No new posts Select first 2 group data vice_versa DFSORT/ICETOOL 10 Mon Jun 13, 2016 2:21 pm
No new posts Query to select Null row on priority RahulG31 DB2 24 Thu Jan 21, 2016 5:45 pm
No new posts Can I use sort to select sample recor... Steve Ironmonger DFSORT/ICETOOL 3 Tue Nov 10, 2015 10:02 pm
No new posts Performance issue in the DB2 program ... Pradst57 DB2 19 Mon Oct 12, 2015 8:31 pm


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