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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many cores do I need for sql server 2016?

947


Explain view in sql server?

1084


How to insert a new row into a table with "insert into" statements in ms sql server?

1010


Can the “if update (colname)” statement be used in a delete trigger?

1032


How to see the event list of an existing trigger using sys.trigger_events?

1125


If you lose rights to your sql server instance what are the options to connect to sql server instance? : sql server security

1102


Write a SQL query to make a column as unique?

1070


What is a sql join?

1079


Write an sql query to find first weekday of the month?

974


What is delete query?

989


What is the default sql server instance name?

1081


Can you explain about buffer cash and log cache in sql server?

993


What are scalar functions in sql?

1202


As a general practice, it is recommended to have dbo be the owner of all database objects however, in your database you find number of tables owned by a user other than dbo, how could you fix this?

1089


What’s the use of custom fields in report?

986