以文本方式查看主题

-  ╋艺 镇╋  (http://zyzsky.com/bbs/index.asp)
--  ┣◇网站建设&Web语言  (http://zyzsky.com/bbs/list.asp?boardid=4)
----  [原创]select 较长的查询语句个人解释  (http://zyzsky.com/bbs/dispbbs.asp?boardid=4&id=2608)

--  作者:admin
--  发布时间:2010/12/10 14:26:52
--  [原创]select 较长的查询语句个人解释
select a.isEncrypt,a.ID,a.product_sn,b.sort_1_cn,c.sort_2_cn from movie as a,sort_1 as b,sort_2 as c where a.sort_1_ID=b.ID and a.sort_2_ID=c.ID a.product_sn like keyword

个人理解:

结构切分:
select

 a.isEncrypt,a.ID,a.product_sn,b.sort_1_cn,c.sort_2_cn

from

movie as a,

sort_1 as b,

sort_2 as c

where

a.sort_1_ID=b.ID

and

a.sort_2_ID=c.ID

a.product_sn like keyword


from后的解释:

从MOVIE表中检索出a.isEncrypt,a.ID,a.product_sn

从sort_1表中检索sort_1_cn项

从sort_2表中检索sort_2_cn项

where解释

检索出符合MOVIE表中sort_1_ID项等于sort_1表中ID和MOVIE表中sort_2_ID项等于sort_2表中ID项的值

 

将isEncrypt、ID等编入A组,从MOVIE表中查询,sort_1_cn编入B组,sort_2编入C组




若有理解错误之处,请高手指点。