Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Consider a table with 8 rows 4 rows contains value 0 and 4
rows contains value 1.Now write a single update query to make
all 0's as 1 and all 1's as 0

Answers were Sorted based on User's Feedback



Consider a table with 8 rows 4 rows contains value 0 and 4 rows contains value 1.Now write a singl..

Answer / ajay sharma

UPDATE mytable set mycolumn = (mycolumn + 1)%2

Is This Answer Correct ?    21 Yes 4 No

Consider a table with 8 rows 4 rows contains value 0 and 4 rows contains value 1.Now write a singl..

Answer / vicky

Update test01 Set num =(case num when 1 then 0 when 0
then 1 else 3 end)

Is This Answer Correct ?    10 Yes 2 No

Consider a table with 8 rows 4 rows contains value 0 and 4 rows contains value 1.Now write a singl..

Answer / shaheem ck

UPDATE <tablename>
SET <columnname> = DECODE(<columnname>,0,1,
1,0,
<columnname>);

Is This Answer Correct ?    4 Yes 3 No

Consider a table with 8 rows 4 rows contains value 0 and 4 rows contains value 1.Now write a singl..

Answer / madhu sudhan g

Hiii Lets take a table Test contains one field No having 8
rows in that 4 rows are with 0's and 4 rows with 1's to update

Update Test
SET No=case when 1 then o
else 1
ENd

Is This Answer Correct ?    0 Yes 0 No

Consider a table with 8 rows 4 rows contains value 0 and 4 rows contains value 1.Now write a singl..

Answer / vernold

Update Table1 Set Column = case when Column = 1 then 0
when column = 0 then 1

Is This Answer Correct ?    5 Yes 7 No

Consider a table with 8 rows 4 rows contains value 0 and 4 rows contains value 1.Now write a singl..

Answer / krishna reddy l

update example set column1 = case when column1=0 then 1
when column1=1 then 0 end

Is This Answer Correct ?    0 Yes 3 No

Consider a table with 8 rows 4 rows contains value 0 and 4 rows contains value 1.Now write a singl..

Answer / vicky saini

Update (tablename) set (coulmn name)=1 where (coulmn name)
=0

Is This Answer Correct ?    1 Yes 6 No

Post New Answer

More SQL Server Interview Questions

How does recursive cte works in sql server?

0 Answers  


Benefits of Stored Procedures?

0 Answers   Wipro,


What is table join?

0 Answers  


What is the beast way to write CTE in SQL Server ?

0 Answers   HCL,


What is sql server query analyzer?

0 Answers  


How can you stop stored procedures from recompiling?

0 Answers  


What’s the use of custom fields in report?

0 Answers  


How do you rebuild an identity column?

0 Answers  


What are the differences between substr and charindex in sql server.

0 Answers  


you notice that the transaction log on one of your databases is over 4gb the size of the data file is 2mb what could cause this situation, and how can you fix it? : Sql server administration

0 Answers  


What are data resources?

0 Answers  


from the table display the 2nd highest salary? and also the least 2nd salay?

8 Answers  


Categories