How to swap the data of two columns in a table. both the
columns containing varchar values.
Answers were Sorted based on User's Feedback
Answer / ami tkumar
Sorry for previous answer.
DECLARE @temp AS varchar(50)
UPDATE swapdata SET @temp=value2,value2=value1,value1=@temp
Is This Answer Correct ? | 5 Yes | 3 No |
Answer / mysql
sorry guys, all ur answers are not working properly.
Try to answer in one sql statement.
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / dinesh
select menu from (select m_name as menu from m_master) a
union select m_name as menu from db2 .dbo.m_master
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / dinesh
select names from
(select full_name as names from table 1) a
union
select full_name as names from table 2
Is This Answer Correct ? | 0 Yes | 2 No |
Answer / san
create table san(empid int,empname varchar(10))
insert into san values(1'san')
update san set empid=empname,empname=empid
Is This Answer Correct ? | 0 Yes | 3 No |
Answer / sandeep rana
create table tmp_t
(
aa varchar2(50),
bb varchar2(50)
)
--insert into tmp_t values('1','5')
select * from tmp_t
update tmp_t set aa=bb , bb=aa
Is This Answer Correct ? | 7 Yes | 12 No |
How you provide security to cube? : sql server analysis services, ssas
Explain what is the use of custom fields in report?
What all db objects can be found in MSDB database of a SQL Server instance?
How to drop an existing table?
Where in ms sql server is ’100’ equal to ‘0’?
how to trace the traffic hitting a sql server? : Sql server database administration
What do mean by xml datatype?
Difference between group by clause and having clause in SQL?
What is a trigger and its types?
What is isolation levels?
Explain the difference between HTTP and HTTPS in database?
how to dispaly a particular row details from a given table