Hello people. I have problem to solve:
Suppose in database is table TAB1(id,numb,text). The task is to exchange two column values in column 'numb' on some query in column 'text'.
For example:
We have
ID | NUMB | TEXT
1 | 22 | hello <- this record
2 | 25 | today
3 | 34 | wow <- this record
4 | 53 | what
After query executed we must have
ID | NUMB | TEXT
1 | 34 | hello <- this record
2 | 25 | today
3 | 22 | wow <- this record
4 | 53 | what
To do this i wrote query:
UPDATE TAB1 AS A, TAB1 AS B SET A.numb=B.numb,B.numb=A.numb WHERE A.numb='hello' AND B.numb='wow';
But this query don't want to execute - popups error 'Recipient B.numb repeated';
Please, give me some suggestions.