부속질의(Subquery) 익히기

## 부속질의(Subquery) 익히기 ##

기호 : AND, OR, IN, NOT IN ...

1. select * from 상품 where ( 색상코드 = ( select 색상코드 from 색상분류 where 색상 = '그린' ) )

2. select * from 소분류코드 where ( 업체코드 IN ( select 업체코드 from 납품업체 where 업체명 IN ('우주','세현','동방') ) )

3. select 상품코드, 사이즈, 재고수량 from 상품 where ( 소코드 = ( select 소코드 from 소분류코드 where 소분류명 = '가죽쟈켓' ) ) and ( 색상코드 = ( select 색상코드 from 색상분류 where 색상 = '블랙' ) )

4. select 상품코드, 사이즈, 재고수량 from 상품 where 재고수량 < ( select AVG(재고수량) from 상품 )

5. select 소코드, AVG(재고수량) AS 소코드별평균 from 상품 group by 소코드 having ( AVG(재고수량) < ( select AVG(재고수량) from 상품 where 소코드 = 'S7' ) )
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기

Posted by 홍반장

2007/03/11 01:35 2007/03/11 01:35
Response
No Trackback , No Comment
RSS :
http://tcbs17.cafe24.com/tc/rss/response/2308

Trackback URL : http://tcbs17.cafe24.com/tc/trackback/2308

« Previous : 1 : ... 4103 : 4104 : 4105 : 4106 : 4107 : 4108 : 4109 : 4110 : 4111 : ... 6391 : Next »

블로그 이미지

- 홍반장

Archives

Recent Trackbacks

Calendar

«   2024/04   »
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30        
Statistics Graph

Site Stats

Total hits:
184534
Today:
323
Yesterday:
639