Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello All,

I have a table like -
          Name          Mobile
1        Sachin        8010023456
2        Kamal         9935463456



We have to return just like as -
          Name       Mobile
1         Blank      Blank
2        Sachin     8010023456
3        Kamal      9935463456
Posted
Updated 30-Sep-13 21:48pm
v2
Comments
Maciej Los 1-Oct-13 3:49am    
Not clear! Please, be more specific and provide more details.
rummer 1-Oct-13 3:52am    
I mean to say I have to 1st row in 2nd row and 2 in 3rd as same continue and 1st row will blank?
Maciej Los 1-Oct-13 3:54am    
See my answer.

Please, read my comment.

I'm not sure what you want to achieve, but have a look at example:
SQL
SELECT NULL AS [Name], NULL AS [Mobile]
UNION ALL
SELECT [Name], [Mobile]
FROM TableName
 
Share this answer
 
If you just want a output with 1st record as blank try this. Replace @t with your table name.


SQL
select ROW_NUMBER()over(order by name), name,phone
 from (
 select '' as name,'' as phone
 union all
 select  name,phone from @t
 ) p
 
Share this answer
 
you should query from table and copy to another table and raname it
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900