Multi-table connection SQL Writing (SQLServer, Oracle)

xiaoxiao2021-03-06  43

Http://www.cnblogs.com/pcsky/archive/2004/10/27/57449.Html Multi-Table Connection SQL Writing (SQLServer, Oracle)

Oracle8

Select a. *, b. * from a, b where A.ID ( ) = B.ID - equivalent to the left

Select a. *, b. * from a, b where a.id = B.ID ( ) - equivalent to the right connection

Oracle9

Support for the above writing, also adding Leftjoin, Right Join, etc.

Select a. *, b. * from a left join b on a.id = B.ID

Select a. *, b. * from a right join b on A.Id = B.ID

SQLServer

Select a. *, b. * from a, b where A.id * = B.ID - equivalent to the left

Select a. *, b. * from a, b where a.id = * B.ID - equivalent to the right connection

Select a. *, b. * from a left join b on a.id = B.ID

Select a. *, b. * from a right join b on A.Id = B.ID

转载请注明原文地址:https://www.9cbs.com/read-51877.html

New Post(0)