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
 

 

How can we retrieve the data from a table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
rameshbabu
Warnings : 1

New User


Joined: 23 May 2005
Posts: 27

PostPosted: Wed Jul 13, 2005 7:10 pm    Post subject: How can we retrieve the data from a table
Reply with quote

Hi
plse clarify my doubt

I want retrieve the first ten columns with out knowing their name(columns)
from a table(table name X)
Back to top
View user's profile Send private message

parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Mon Jul 18, 2005 5:47 pm    Post subject:
Reply with quote

Hi Ramesh babu,

Its not possible to retrive first N columns from a database table.
Back to top
View user's profile Send private message
Gops

New User


Joined: 21 Jul 2005
Posts: 23

PostPosted: Tue Aug 02, 2005 3:44 pm    Post subject: Re: How can we retrieve the data from a table
Reply with quote

Hi Guys,

Try out these queries.

select * from TABLENAME fetch first row only;

select * from TABLENAME fetch first 50 rows only; ==> will fetch first 50 rows from the table.

Cheers icon_smile.gif
Gops
Back to top
View user's profile Send private message
paru

New User


Joined: 24 Jun 2005
Posts: 9
Location: INDIA

PostPosted: Wed Aug 03, 2005 3:59 pm    Post subject:
Reply with quote

The queries suggested would only fetch select rows and not select colomns.i.e, in the example stated the 50 rows would contain all the colomns.So i think its not possible to select certain colomns alone from any table.

Cheers,
Paru
Back to top
View user's profile Send private message
Prasanthhere

Active User


Joined: 03 Aug 2005
Posts: 306

PostPosted: Wed Aug 03, 2005 4:36 pm    Post subject: Re: How can we retrieve the data from a table
Reply with quote

Try out these queries.

select * from TABLENAME fetch first N only; where n= no of rows u want2 fetch
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 Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm


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