Need_help_in_an_update_query
hi
i have a requirement, wherein i have to update records in such a way that each student's marks are copied in a new column of the next student record.
can anybody help me with it please
regards
~aamir
Your query will always set NULL values to New_mark as where condition never met and you always get NULL from sub query.....However,here one of the solution with co-related quries...
UPDATE emp t
SET new_marks = (SELECT marks FROM emp e WHERE e.id=t.id-1) ;
Output
ID NAME MARKS NEW_MARKS
1 imran 5
2 bilal 10 5
3 sajjad 15 10
4 sameer 20 15hope it helps..
Edited by: imkhan on Oct 22, 2012 4:13 PM
Similar Messages
Maybe you are looking for
-
This is my site http://globaledsource.com/ then the characters is not showing correctly. This is what happen in my site http://globaledsource.com/wp-content/uploads/2013/03/MAS_ThemeProbleme-1024x1024.jpg
-
Trouble with using MX Templates in DW8
I had a question that I just cannot seem to figure out. My company recently bought Macromedia's Studio 8 Upgrade for the Design department. We used to use Dreamweaver MX. We did not have any problems with MX, with images showing in the Design window.
-
How to download and upload a module pool program ?
hi i am a sudent.can anyone suggest me how to download and upload a module pool program? Moderator message: please search for available information/documentation. Edited by: Thomas Zloch on May 29, 2011 12:45 PM
-
Newbie functional question on MM Invoice Verification
Dear forumers, How can I check for a completed status of an invoice verification in the SAP MM module? I was told that this can be checked from the RBKP-RBSTAT field. Is it also right to say that RBSTAT = 'B' to indicate that the invoice verification
-
Bought one year of minutes for $100, why do I need to add more in 6 months?
I recently purchased a Verizon pre-paid, along with $100 of minutes that were to last for a year. When I check my balance it says I need to add more by October, approx. 6 months from initial purchase. I won't need more by then as the phone is hard