現在的笨方法就是不斷的用SELECT 子句:如下
select * from order_item
select * from order_item where order_no in (select order_no from [order] where order_no = 'dr9999')
select * from ko where order_no in (select order_no from [order] where order_no = 'dr9999')
select * from dye where ko_no in (select ko_no from ko where order_no in (select order_no from [order] where order_no = 'dr9999'))
select * from templet where dye_no in (select dye_no from dye where ko_no in(select ko_no from ko where order_no in (select order_no from [order] where order_no = 'dr9999')))
select * from tub where tmp_no in (select tmp_no from templet where dye_no in (select dye_no from dye where ko_no in (select ko_no from ko where order_no in (select order_no from [order] where order_no = 'dr9999'))))
這樣不盡我覺得效率很低,且代碼多,維護起來很難。
不過,沒有用過select子句的朋友,看了這個有什麼感受哪?好玩吧。