LIMIT 1
#1

When should I use LIMIT 1 in mysql?

Thanks.
Reply
#2

when you only want one result, usualy when getting the biggest/smallest value or something
Reply
#3

Okay, thanks, do you also know how to delete an user, which is stored in a table?
Reply
#4

The syntax for that is
Код:
 DELETE FROM "table_name" WHERE {condition}
Reply
#5

I would strongly recommend putting "LIMIT 1" at the end of that statement. (If you only want to delete 1 row) I have deleted multiple rows by accident sometimes. Really annoying.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)