July 15, 2011 at 2:22 am
Hi,
Let me explain the scenario :
I have two tables T1 & T2 and a mapping table T3 which relates the tables T1 & T2.
T1 has two columns ref & status & T2 has two columns id & status. One ref can have 1 to 'n' no of id's. and each id can have different status.
Suppose if in T1 the status of Ref 101 is 2 , for the same ref 101 we have 3 different id's on T2 and each id has different status (1,4,3).
Now what I need is that I have to update the status in T1 with the status from T2. For the above case i need to update 4 as the status for 101.(I have attached a spreadsheet for reference).
If there are more than 1 status for id's i need to update with the status that has the highest priority .
in the above example status 4 has the highest priority among 1 & 3 so I need to update 4 for ref 101.
I have included the priority in the spreadsheet.
I need to create a stored procedure to do this job. how can I do this.
July 15, 2011 at 6:20 am
This was removed by the editor as SPAM
July 15, 2011 at 6:30 am
No, the priority is not stored in a table.
July 15, 2011 at 7:30 am
This was removed by the editor as SPAM
July 15, 2011 at 8:20 am
OMG:w00t::w00t::w00t: !!! Thanks a TON Stewart for spending your precious time to help me out!!!!!!!! This is what I have been looking out for .. Thanks Once Again :-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-):-)!!!!!!!!!!!!
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply