두 개의 열이 where 절에서 같은지 비교하고 싶습니다. 열 두 개의 열이 where 절에 두 개의 열이 같은지 비교하는 경우
이
에 가입 된 다른 테이블 출신이다 내가SELECT authors.state, sum(qty*price)as sales_revenue
from authors,titles, stores, sales
WHERE authors.state = (SELECT stores.state from stores)
을 사용하고있는 문이다 그러나 나는
sg 8120, Level 16, State 1, Line 1
Column 'authors.state' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
그냥 참고 : 제목의 데카르트 제품이있다. + 판매 + (저자 + 제목). 따라서 쿼리에서 반환 된 데이터는 의미가 없습니다. – zerkms
지금 쿼리를 게시 할 수 있습니까? 또한 수량과 가격이 둘 이상의 테이블에 정의되어 있습니까? – JPM