Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to delete one row in mysql?

I have mysql database in that i have below table values.

mysql> select * from account_external_ids where external_id like "%rajesh.m%";
+------------+-----------------------+----------+----------------------------------------------------------+
| account_id | email_address         | password | external_id                                              |
+------------+-----------------------+----------+----------------------------------------------------------+
|          1 | rajesh.m@company.com | NULL      | gerrit:rajesh.m                                          |
|          1 | rajesh.m@company.com | NULL      | http://160.155.187.158:8095/openidserver/users/rajesh.m  |
|          1 | NULL                 | NULL      | username:rajesh.m                                        |
+------------+-----------------------+----------+----------------------------------------------------------+
3 rows in set (0.00 sec)

I need to delete 1 | rajesh.m@company.com | NULL | http://160.155.187.158:8095/openidserver/users/rajesh.m row.

I’m worried to run delete from account_external_ids where account_id in (1); not sure whether it will delete first row.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Need advise in deletion.

>Solution :

You are trying to delete a row but not a column. You can delete the row with the following statement:

delete from account_external_ids where external_id =
“http://160.155.187.158:8095/openidserver/users/rajesh.m”;

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading