If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > select using coulmn number

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-25-04, 00:20
melb melb is offline
Registered User
 
Join Date: Aug 2003
Location: AUS
Posts: 26
select using coulmn number

hi all,
is there any chance to select records using column i.d

say SELECT (COLUMN i.d) FROM X; which gets the data's of the coumn number

cheers
Reply With Quote
  #2 (permalink)  
Old 05-25-04, 01:09
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi melb,

Do you mean sorting the column1?
SELECT COLUMN_id FROM X ORDER BY COLUMN_id;

If needed descending order then write DESC at the end of the command:
SELECT COLUMN_id FROM X ORDER BY COLUMN_id DESC;

Hope this helps,
Grofaty
Reply With Quote
  #3 (permalink)  
Old 05-25-04, 02:41
melb melb is offline
Registered User
 
Join Date: Aug 2003
Location: AUS
Posts: 26
Hi Grofaty,
Thanks for your reply ? I will ask the question in detail.

example :
Table a

name address phone
aaa aaaa 9999
bbb bbbb 8888

is there any command like using the column id instead of name.
say
SELECT columnid(1) from a;
instead of
SELECT address from a;

cheers
melb
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On