Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 First record get query

Author  Topic 

netkannan
Starting Member

1 Post

Posted - 2010-02-22 : 02:22:17
how to get first record on a table using sql query

KANNAN

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-02-22 : 02:41:08
[code]select top 1 * from yourtable order by <some column>[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-02-22 : 03:52:06
quote:
Originally posted by netkannan

how to get first record on a table using sql query

KANNAN


There is no concept of first,middle or last record in Relational Databases

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-22 : 08:17:11
quote:
Originally posted by netkannan

how to get first record on a table using sql query

KANNAN


you need to specify the order by means of column (pk column may be)

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -