RT
Eg: has the following form
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Id name status
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Test1 1
2 test2 1
3 test2 1
4 test2 1
5 test2 1
6 test2 1
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - line -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
The following for the SQL statement
The UPDATE TABNAME SET name='zhangsan' WHERE the status=1
Affect the number of lines after the above statement is executed for six lines, now want to ask you a great god, how can you get this 6 lines of the primary key ID (6)
Thanked everybody first
CodePudding user response:
By the way, in the case of not use stored procedures, SQL statements can be fulfilled only??
CodePudding user response:
Select the id from TABNAME WHERE status=1 and name<> 'zhangsan' this is the need to change the record
CodePudding user response: