글수 2,699
sql에 무뇌한이라...
아래같이 이너쿼리에서 받은 컬럼이 두개이면 실행이 안되네요
그저 문법이 틀렸다고 나옵니다.
이게 책에 나오는건데 말입니다.
무슨 문제인가요?
sql서버2005입니다.
select distinct customer_name
from borrower, loan
where borrower.loan_number = loan.loan_number and branch_name = 'Perryridge' and
(branch_name, customer_name) in
(select branch_name, customer_name
from depositor, account
where depositor.account_number = account.account_number)
아래같이 이너쿼리에서 받은 컬럼이 두개이면 실행이 안되네요
그저 문법이 틀렸다고 나옵니다.
이게 책에 나오는건데 말입니다.
무슨 문제인가요?
sql서버2005입니다.
select distinct customer_name
from borrower, loan
where borrower.loan_number = loan.loan_number and branch_name = 'Perryridge' and
(branch_name, customer_name) in
(select branch_name, customer_name
from depositor, account
where depositor.account_number = account.account_number)
blog: http://ljh131.tistory.com
email: ljh131@gmail.com

3번째 줄 맨 오른쪽에 branch_name = 'Perryridge' 에서 branch_name 에서 테이블 이름이 없내요. 물론 두 테이블에서 서로 다른 필드 이름을 사용하면 구별할 수 있을 것 같긴하지만..
근데 in 이라는 문법에서 저렇게 2가지를 한꺼번에 받을 수 있는 것인지 모르겠군요. sql 2005 확장기능인가??
정확히 알려면 borrower, loan , depositor, account 테이블이 어떤 필드로 이루어져 있는지에 대한 정보가 있어야 한 것 같군요.