THE SQL Code is as follows for without column No field:
SELECT ALSubject FROM Subject_Table
SUBJECTS
Accountancy
Applied Maths
Buniness Studies
Economics
Statistics
Zoology
*********************************************************
The code sql code with adding a column
method:-1
SELECT Row_Number() OVER (order by ALSubject asc) as ID,t.ALSubject As Name FROM ( SELECT ALSubject FROM Subject_Table) t
method:-1
SELECT Row_Number() OVER (order by ALSubject asc) as ID , ALSubject AS Name FROM Subject_Table where ALSubject<>'' group by ALSubject
ID NAME
1 Accountancy
2 Applied Maths
3 Business Studies
4 Economics
5 Statistics
6 Zoology
Subscribe to:
Post Comments (Atom)
SQL Query Stuff
1 . By using this query can search any string contain within stored procedure, function or view SELECT object_name(id) FROM sys.sysc...
-
Code Output DECLARE @count INT DECLARE @ct INT DECLARE @print varchar(10) SELECT @count =10 WHILE @count > 0 BEGIN SELECT @pr...
-
****> **add name="ConToSOLDB" connectionString="Data Source=db-svr\MSSQL2008; Database=SOLV3; User Id=sa; password=...
-
In the Following code i am going to generate a Grid view with dynamic check box columns. as u can seen on the picture...
No comments:
Post a Comment