|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
'First' not supported in SQL Server
I am using following query in access
Select first(fname),age from mytab group by age Database : Sam 21 Raj 21 Karan 21 John 23 Rocky 23 O/P of Query : Sam 21 John 23 I want to use the same query in SQL Server,But First keyword is not supported in SQL Server.So how can I write my own function 'first' in SQL Server, so that I will not need to change above query in SQL Server also and it should give same result. |
|
#2
|
|||
|
|||
|
Use top instead of first
Use
Select TOP2 * from [tablename]; I Hope this would solve your querry! Quote:
|
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft SQL Server > 'First' not supported in SQL Server |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|