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

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

QA

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

본문


 $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";

 

빨강은 제거되어야 하고

파랑은 추가되어야 하고 

이 문제로 보입니다.

답변을 작성하시기 전에 로그인 해주세요.
전체 123,620 | RSS
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT