View previous topic :: View next topic
|
Author |
Message |
Elixir
Active User
Joined: 08 Feb 2009 Posts: 116 Location: CHENNAI/NEW JERSEY - INDIA/USA
|
|
|
|
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 |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
it should be perfectly clear if those smilies weren't so distracting.
Just read the manual. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
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 |
|
|
Elixir
Active User
Joined: 08 Feb 2009 Posts: 116 Location: CHENNAI/NEW JERSEY - INDIA/USA
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
|