Page 1 of 1

URGENT . .. SELECT clause doubt

Posted: Thu Nov 06, 2008 8:44 am
by abh_kol
I have a doubt in a DB2 Query. The query is like...

SELECT 1 FROM <tablename> WHERE . . . . .

It returns the value 1111111111111111111111111 (specific no of 1's). If the query is changed to

SELECT 2 FROM <tablename> WHERE . . . . .

It returns the value 2222222222222222222222222 (specific no of 2's).

Can any one please explain me what's happening here??

Posted: Thu Nov 06, 2008 9:41 am
by Natarajan
simple answer is -
If n rows are satisfied for that condition given in where clause, those many number of one's/two's are got displayed in the output.

Let me know, if my answer not cleared your doubt

Posted: Thu Nov 06, 2008 2:52 pm
by dbzTHEdinosauer
are you running this as spufi/qmf or imbedded sql?

are you really getting 1111111
or
1
1
1
1
1
?
Natarajan provided you with an accurate answer.

Thanks a Ton !!!!!

Posted: Mon Nov 10, 2008 8:55 am
by abh_kol
Yeah .. . That clears me the doubt I had. . . .

Thanks a Ton . . ..