English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

i know it means all fields , but can I not using it ?

2006-10-17 06:27:52 · 6 answers · asked by Manzo Crich 1 in Computers & Internet Programming & Design

6 answers

According to the SQL 92 standard:
::=
DELETE FROM


[ WHERE ]

So, you do not need a * at all.

However, I have seen some mentions on the web of a slightly different - non-standards compliant syntax which includes a
.* before the FROM. If your particular database requires it, then you would have to put it there.

2006-10-17 06:42:09 · answer #1 · answered by Leo Z 2 · 0 0

The star is not necessary in a DELETE query. People just tend to accidentally put it there because of the similarity to a SELECT query.

2006-10-17 13:59:58 · answer #2 · answered by Chris J 6 · 0 0

It's purpose is to make it slightly more difficult to migrate away from Microsoft's version of SQL.

2006-10-17 13:56:51 · answer #3 · answered by Anonymous · 0 0

there is no purpose.
And no place to put it either. In standard sql anyway.
the correct syntax is:
delete from foo where bar='baz';

Adding a * here would be a syntax error

2006-10-17 13:35:32 · answer #4 · answered by n0body 4 · 1 0

No purpose at all. Technically, you don't need the FROM, either. DELETE myTable WHERE myTable.Field = @Parameter... or whatever.

2006-10-17 13:41:21 · answer #5 · answered by Kaptain Krakatoa 3 · 0 0

Why would you need it? When you delete something from a db you delete an entire row to begin with.

2006-10-17 13:37:16 · answer #6 · answered by Robert G 2 · 0 2

fedest.com, questions and answers