i have a RECID,regionID, areaID ,UserID ,AppNo, NextAppNo(Accepts null)
and data is as follow
(NextApp is in the first row only)
1,102,Ar-1,xyz,1,1
2,102,Ar-1,,erer,2
3,102,Ar-1,tyty,3
4,102,Ar-1,tyty,4
1)
now i want to add another record
what i am doing is
first getting the max number of APPID where areaID = Ar-1 and regionID =102
and then check that if max appNo we got from query is 0 then add nextappNo otherwise not
and then inserting into db now is it possible to do it in one query
2)
now i want to delete the first record what i am doing now is first selecting data where areaID = Ar-1 and regionID =102
and now in loop i check if Recid is the same id we want to delete.
and from there onward i update the the column approver and also if the record which we are going to delete has approverNO = 1 then also update the next approver to one of the next record.
then delete the record from table.
Reply if anything is unclear which i am expexting from my bad english.