Click here to Skip to main content
15,892,927 members
Home / Discussions / Database
   

Database

 
GeneralRe: Return value from a stored procedure Pin
Member 42602701-Dec-09 20:37
Member 42602701-Dec-09 20:37 
AnswerRe: Return value from a stored procedure Pin
Andy_L_J1-Dec-09 20:07
Andy_L_J1-Dec-09 20:07 
Questionsearching problem in SQL server 2005 Pin
hvgyufg28fh38tyr78hf1-Dec-09 18:47
hvgyufg28fh38tyr78hf1-Dec-09 18:47 
AnswerRe: searching problem in SQL server 2005 Pin
_Damian S_1-Dec-09 19:02
professional_Damian S_1-Dec-09 19:02 
GeneralRe: searching problem in SQL server 2005 Pin
hvgyufg28fh38tyr78hf1-Dec-09 19:39
hvgyufg28fh38tyr78hf1-Dec-09 19:39 
GeneralRe: searching problem in SQL server 2005 Pin
Mycroft Holmes1-Dec-09 22:00
professionalMycroft Holmes1-Dec-09 22:00 
QuestionRegarding replication of image type data between two database servers Pin
Dhisni De Costa1-Dec-09 17:29
Dhisni De Costa1-Dec-09 17:29 
Questionquery needed to swap column values for duplicate Pin
xcavin1-Dec-09 13:26
xcavin1-Dec-09 13:26 
userid	status	phone_number
1	0	111
2	1	111	
3	0	222
4	1	222
5	0	333
6	1	444


For the above table I want write a SQL query to swap the value of "status" column for duplicate rows. Duplicates can be identified if phone number is same. The output would look like as below (affecting only 1,2,3 and 4).

userid	status	phone_number
1	1	111
2	0	111	
3	1	222
4	0	222
5	0	333
6	1	444

Any help is appreciated. I always find it always hard to write even a simple SQL query Frown | :(
AnswerRe: query needed to swap column values for duplicate Pin
_Damian S_1-Dec-09 13:48
professional_Damian S_1-Dec-09 13:48 
GeneralRe: query needed to swap column values for duplicate Pin
xcavin1-Dec-09 13:59
xcavin1-Dec-09 13:59 
GeneralRe: query needed to swap column values for duplicate Pin
_Damian S_1-Dec-09 14:05
professional_Damian S_1-Dec-09 14:05 
GeneralRe: query needed to swap column values for duplicate Pin
Luc Pattyn1-Dec-09 15:06
sitebuilderLuc Pattyn1-Dec-09 15:06 
GeneralRe: query needed to swap column values for duplicate Pin
_Damian S_1-Dec-09 15:58
professional_Damian S_1-Dec-09 15:58 
QuestionTransposing rows and Columns in SQL Pin
Leo Smith1-Dec-09 8:05
Leo Smith1-Dec-09 8:05 
AnswerRe: Transposing rows and Columns in SQL Pin
Niladri_Biswas1-Dec-09 15:54
Niladri_Biswas1-Dec-09 15:54 
Questionuser import Pin
AndyInUK1-Dec-09 6:30
AndyInUK1-Dec-09 6:30 
AnswerRe: user import Pin
loyal ginger1-Dec-09 6:44
loyal ginger1-Dec-09 6:44 
GeneralRe: user import Pin
AndyInUK1-Dec-09 22:08
AndyInUK1-Dec-09 22:08 
GeneralRe: user import Pin
loyal ginger2-Dec-09 3:43
loyal ginger2-Dec-09 3:43 
AnswerRe: user import Pin
Shameel1-Dec-09 6:56
professionalShameel1-Dec-09 6:56 
GeneralRe: user import Pin
loyal ginger1-Dec-09 7:01
loyal ginger1-Dec-09 7:01 
GeneralRe: user import Pin
AndyInUK1-Dec-09 22:08
AndyInUK1-Dec-09 22:08 
GeneralRe: user import Pin
Shameel2-Dec-09 6:53
professionalShameel2-Dec-09 6:53 
GeneralRe: user import Pin
AndyInUK3-Dec-09 0:34
AndyInUK3-Dec-09 0:34 
GeneralRe: user import Pin
Shameel4-Dec-09 6:59
professionalShameel4-Dec-09 6:59 

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.