Click here to Skip to main content
15,887,776 members
Home / Discussions / Database
   

Database

 
AnswerRe: SQL Server 2008 Pin
jschell11-Feb-13 8:20
jschell11-Feb-13 8:20 
Questionupdate values in a table in single query Pin
nainakarri7-Feb-13 20:07
nainakarri7-Feb-13 20:07 
AnswerRe: update values in a table in single query Pin
Mycroft Holmes7-Feb-13 21:00
professionalMycroft Holmes7-Feb-13 21:00 
GeneralRe: update values in a table in single query Pin
Shameel10-Feb-13 22:38
professionalShameel10-Feb-13 22:38 
GeneralRe: update values in a table in single query Pin
Mycroft Holmes11-Feb-13 13:30
professionalMycroft Holmes11-Feb-13 13:30 
AnswerRe: update values in a table in single query PinPopular
Eddy Vluggen7-Feb-13 22:42
professionalEddy Vluggen7-Feb-13 22:42 
GeneralRe: update values in a table in single query Pin
gvprabu10-Feb-13 18:02
gvprabu10-Feb-13 18:02 
AnswerRe: update values in a table in single query Pin
gvprabu20-Feb-13 21:43
gvprabu20-Feb-13 21:43 
Hi Naina,


Check the Script, U can use CASE Statement in UPDATE.

SQL
CREATE TABLE #EmpDtls(ID INT, EmpGender CHAR(1))
INSERT INTO #EmpDtls (ID, EmpGender) VALUES (1,'M'),(2,'F'),(3,'M')

SELECT ID, EmpGender FROM #EmpDtls 
-- Update Statement
UPDATE #EmpDtls SET EmpGender = (CASE WHEN EmpGender='M' THEN 'F' WHEN EmpGender='F' THEN 'M' END)

SELECT ID, EmpGender FROM #EmpDtls 


Regards,
GVPrabu
QuestionIs it possible to print a variable in stored procedure Pin
Deepthi.214567-Feb-13 19:45
Deepthi.214567-Feb-13 19:45 
AnswerRe: Is it possible to print a variable in stored procedure Pin
nainakarri7-Feb-13 20:22
nainakarri7-Feb-13 20:22 
GeneralRe: Is it possible to print a variable in stored procedure Pin
vanikanc12-Feb-13 8:19
vanikanc12-Feb-13 8:19 
QuestionVisual Studio 2005 Access 2010 Database Pin
Member 98194707-Feb-13 12:06
Member 98194707-Feb-13 12:06 
AnswerRe: Visual Studio 2005 Access 2010 Database Pin
Mycroft Holmes7-Feb-13 13:45
professionalMycroft Holmes7-Feb-13 13:45 
QuestionSimulate transaction: non blocking insert / update Pin
Bob Stanneveld7-Feb-13 11:12
Bob Stanneveld7-Feb-13 11:12 
AnswerRe: Simulate transaction: non blocking insert / update Pin
Mycroft Holmes7-Feb-13 13:44
professionalMycroft Holmes7-Feb-13 13:44 
QuestionPropagating a MySQL transaction with MSMQ II Pin
Ger Hayden6-Feb-13 8:08
Ger Hayden6-Feb-13 8:08 
QuestionMissing Data in an Access Report Pin
Vimalsoft(Pty) Ltd6-Feb-13 3:03
professionalVimalsoft(Pty) Ltd6-Feb-13 3:03 
AnswerRe: Missing Data in an Access Report Pin
jschell6-Feb-13 8:11
jschell6-Feb-13 8:11 
GeneralRe: Missing Data in an Access Report Pin
Vimalsoft(Pty) Ltd6-Feb-13 19:01
professionalVimalsoft(Pty) Ltd6-Feb-13 19:01 
GeneralRe: Missing Data in an Access Report Pin
jschell7-Feb-13 9:52
jschell7-Feb-13 9:52 
AnswerRe: Missing Data in an Access Report Pin
Mycroft Holmes6-Feb-13 12:27
professionalMycroft Holmes6-Feb-13 12:27 
GeneralRe: Missing Data in an Access Report Pin
Vimalsoft(Pty) Ltd6-Feb-13 19:06
professionalVimalsoft(Pty) Ltd6-Feb-13 19:06 
GeneralRe: Missing Data in an Access Report Pin
Mycroft Holmes6-Feb-13 20:27
professionalMycroft Holmes6-Feb-13 20:27 
GeneralRe: Missing Data in an Access Report Pin
Vimalsoft(Pty) Ltd6-Feb-13 20:32
professionalVimalsoft(Pty) Ltd6-Feb-13 20:32 
GeneralRe: Missing Data in an Access Report Pin
jschell7-Feb-13 9:56
jschell7-Feb-13 9:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.