I don't know the meaning of where 1 1? Thanks fo your answer.
Asked
Active
Viewed 329 times
-3
-
look into this [here](http://stackoverflow.com/questions/3000917/delete-all-from-table) – KOTIOS Feb 13 '15 at 04:08
-
Please find such similar question on Google search before asking here – Kirtikumar A. Feb 13 '15 at 04:13
-
It will help you when you are building dynamic WHERE clause. – Yuva Raj Feb 13 '15 at 04:38
-
possible duplicate of [Why would someone use WHERE 1=1 AND
in a SQL clause?](http://stackoverflow.com/questions/242822/why-would-someone-use-where-1-1-and-conditions-in-a-sql-clause) – Yuva Raj Feb 13 '15 at 04:40 -
`WHERE 1=1 OR ....` is used in SQL injection attacks: http://www.w3schools.com/sql/sql_injection.asp – Phantômaxx Feb 13 '15 at 08:25
2 Answers
1
1=1
is true for any row. Therefore, DELETE FROM tablename WHERE 1=1
deletes all rows. DELETE * ...
with the asterisk is syntactically incorrect in sqlite.
Also DELETE FROM tablename
deletes all rows.

laalto
- 150,114
- 66
- 286
- 303
0
their is no such statement like delete * from tablename where 1=1.
because where clause is used to give condition so that compiler can get the data according to that condition, u can write where columnname= value. Inside this u can write the particular column name and value on bass of which u want to delete some data.

Sahil Garg
- 263
- 1
- 20