F How to show first 3 rows of data in database in Microsoft SQL Server | CodeTheta

How to show first 3 rows of data in database in Microsoft SQL Server


Database Name - demo
Table Name - employee

id name      phone      city       salary     company
1 suresh     8100011485 mumbai     20000      abc       
2 subhash    8511144785 kolkata    25000      bcd       
3 nitesh     5844411572 delhi      24000      nhc       
4 nirabh     1245810145 goa        26900      njo       
5 sourav     2544844152 kashmir    24120      lpf       
6 bonny      6245874125 bihar      24500      rfg       

Code :
SELECT TOP 3 [id]
      ,[name]
      ,[phone]
      ,[city]
      ,[salary]
      ,[company]
  FROM [demo].[dbo].[employee

Output :
id name      phone      city       salary     company
1 suresh     8100011485 mumbai     20000      abc       
2 subhash    8511144785 kolkata    25000      bcd       
3 nitesh     5844411572 delhi      24000      nhc       

IDE Used To Test This Code : Microsoft SQL Server Management Studio 2014.

Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us.We will reply you as soon as possible.

Post a Comment