COMING SOON 🚀

채택완료

쿼리문 좀 알려주세요~

select f1, f2, f3 from table1 A where A.wr_id IN (select wr_id from table2 where wr_id > 100);

 

table1과 table2에서 wr_id를 참조하여 table1의 f1, f2, f3값을 추출하는 쿼리인데

table2의 f4 필드값도 함께 추출하려면 어떻게 손을 봐야하는지 좀 알려주세요 ( _ _ )

|

답변 1개 / 댓글 1개

채택된 답변
+20 포인트

Copy
select f1, f2, f3 from table1 A where A.wr_id IN (select wr_id from table2 where wr_id > 100);

=>

select a.f1,a.f2,a.f3 , b.f4 from table1 as a inner join table2 as b on a.wr_id=b.wr_id where b.wr_id > 100

 

이렇게 바꿔보세요

답변에 대한 댓글 1개

정말 감사합니다~

답변을 작성하려면 로그인이 필요합니다.