3개의 달력데이터 통합..(union all명령어)

3개의 달력데이터 통합..(union all명령어)

QA

3개의 달력데이터 통합..(union all명령어)

답변 1

본문


 $query = "SELECT * FROM (select * from g5_trc_write_trcall1001 union all select * from g5_trc_write_g01sch union all select * from g5_trc_write_g02sch union all select * from g5_trc_write_g03sch union all ) WHERE left(wr_1,6) <= '$year$sel_mon' and left(wr_2,6) >= '$year$sel_mon' ORDER BY wr_id ASC";

 

위처럼 union 을 하였는데.. 데이터를 못 불러오네요.. 무엇이 문제일까요?

이 질문에 댓글 쓰기 :

답변 1

"SELECT * FROM (select * from g5_trc_write_trcall1001 union all select * from g5_trc_write_g01sch union all select * from g5_trc_write_g02sch union all select * from g5_trc_write_g03sch union all ) X WHERE left(wr_1,6) <= '$year$sel_mon' and left(wr_2,6) >= '$year$sel_mon' ORDER BY wr_id ASC";

 

빨강은 제거되어야 하고

파랑은 추가되어야 하고 

이 문제로 보입니다.

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 11
© SIRSOFT
현재 페이지 제일 처음으로