Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Dear Friend solve this simple query.

Following is table structure
Table Name: Present
Id IsPresent
1 P
2 P
3 A
4 A

Write query in sql to update all ‘P’ from IsPresent field to ‘A’ and all ‘A’ to ‘P’.
Expected Ans:
Id IsPresent
1 A
2 A
3 P
4 P


Thanks in advanced !
Posted
Comments
[no name] 15-Jul-13 9:37am    
So what query have you tried and what was the problem with it?

1 solution

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!
 
Share this answer
 
Comments
Johnny J. 15-Jul-13 14:40pm    
You don't, Griff, but clearly Radhadeep12 does. I wish people would stop answering questions that are clearly meant for the OP to learn something by himself... :-(
OriginalGriff 15-Jul-13 14:53pm    
Depressing, but true...
Member 8089110 16-Jul-13 7:28am    
Sorry friends regarding this question its my first mistake and features i will not this kind of mistakes..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900