In SQL syntax, is 'from' in 'delete from' optional if you plan to use 'where'?

前端 未结 3 1508
被撕碎了的回忆
被撕碎了的回忆 2021-01-17 08:34

I am new to SQL. We have some code that should work on SQL Server 2005/2008, Oracle 10 as well as Sybase.

I was writing a script to try to figure out which tables a

3条回答
  •  逝去的感伤
    2021-01-17 09:36

    At this place the FROM is optional (SQL Server, Oracle, Sybase).

    However, there are subtle differences: Oracle for instance allows assigning an alias to the table name, where SQL Server doesn't; and other things are also a little bit different.

    Also note that your FROM sample is differnet from the following where it is mandatory:

    DELETE phone_book FROM some_table WHERE ...
    

提交回复
热议问题