geeks,
plz help me with sql query
i have a table like this
p_name | qty
| batchno
| vendor | Odr flag
|
disprin | 20 | b5 | A | ordered |
crocin | 5 | d3 | B | null |
disprin | 12 | b6 | B | ordered |
(new insert)
| 2 | g3
| w
| null
|
you see here disprin is indicating ordered from Odr flag
while crocin has null value in odr flag as not been ordered yet .
now i want when i insert another entry (for example disprin) then query checks if its Odr col has value 'Ordered' then update it as null in all the rows having P_name 'disprin' .
so on inserting disprin it should be like this
p_name | qty
| batchno
| vendor | Odr flag
|
disprin | 20 | b5 | A | null |
crocin | 5 | d3 | B | null |
disprin | 12 | b6 | B | null |
disprin
| 2 | g3
| w
| null
|
help me guys. any help will be appreciated .