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 |
Define Check points and End Points?
Can a function call a stored procedure in sql server?
How to write a query with a full outer join in ms sql server?
What is sql server transaction log file?
Does group by sort data?
When columns are added to existing tables, what do they initially contain?
What does it mean if @@cursor_row returns a negative number?
Why should you use or avoid select * statements?
can an automatic recovery be initiated by a user? : Sql server administration
What is referential integrity? What are the advantages of it?
4 Answers Descon, Digital Domain,
What the different components of Replication and what is their use?
Suppose you want to implement the one-to-one relationships while designing tables. How would you do it?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)