3

I want to unlock the columns which appearing in the following pic:

https://i.stack.imgur.com/3F7cb.png

I know that the answer is make id a primary key. but the problem here is that I can't make id a primary key because there are two rows empty in id column and I can't delete these rows because the column locked! Please try to help me. Thank you very much

Fofah
  • 31
  • 1
  • 3

3 Answers3

5

You cannot update or delete rows if you don't have primary key. That is the reason they're locked. It's impossible to identify rows uniquely for update/delete queries to run.

0

It happens when we have not turn on the primary key on our column of any which we want to make primary key . just go to the properties of the table and turn on the primary key of your column which you want to make primary key.

0

Adding to the above correct answers, if in your query you can include the primary key , for example id , then the result set won't have locked data.

select id, name, username from users where username = 'abc';

insted of select name, username from users where username = 'abc'; which locks the result set.

Walker
  • 891
  • 2
  • 11
  • 26