Results 1 to 6 of 6
Thread: Insert/Update query help.
Apr 7, 2008, 02:06 #1
- Join Date
- Oct 2007
- 0 Post(s)
- 0 Thread(s)
Insert/Update query help.
Im using mysql 5.0. I am doing a insert/update query for a particular record. The situation here is, I'm doing a select query first to check whether the given record is present or not, my select query is-->
If the req_code value is not present in the table, i do an insert query as--->
If the req_code value is present, i do an update query as---->
All this is working fine, but now the problem here is, suppose the req_code is R42141620 and i select a new Expenditure_code(there are many expenditure_code) value 41620105, for the same req_code as compared to 41620101 in the above example, i want a duplicate req_code to be enterred with the new expenditure_code value without changing the existing set up.
The output should be something like this---->
Req_code expenditure_code amount destination amount_paid R42141620 41620101 10000 Lucknow 0
Req_code expenditure_code amount destination amount_paid R42141620 41620101 10000 Lucknow 0 R42141620 41620105 12000 Lucknow 0
Any help here is appreciated.