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
What stored procedure would you use to view lock information?
What is index, cluster index and nonclustered index?
What is difference between commit and rollback when used in transactions?
Describe in brief sql server monitoring ways.
This question asked during interview, 2) At the end of each month, a new table is created for each bank that contains monthly metrics consolidated at the account level. The table naming convention is bankX_YYYYMM where X represents the numeric designation of the bank and YYYYMM indicates the 4 digit year and 2 digit month. The tables contain the following fields: name data type description account text account number registered boolean indicates whether the account is registered num_trans integer number of transactions made during the time period spend numeric(9,2) total spend during the time period a) Write a SQL query that will display the total number of transactions and total spend for "Bank1" during the 4th quarter of 2009. b) Write a SQL query that will display the total number of transactions and total spend at "Bank1" and "Bank2", broken out by registered vs. non-registered accounts, during January 2010 not sure what is correct answer and how to solve?
How do use Having,Group by,Group function in SQL?
What are built in functions?
Can you create a logon trigger in sql server 2005 express edition?
What is normalization? Describe its different types.
What do you understand by the analysis services in sql server?
What is the user of Primary key?
What is subreport?
Write an sql query to find first weekday of the month?
What are the ways available in sql server to execute sql statements?
What are the purposes of floor and sign functions?