Copy
$reserve=sql_query("select * from $reser_table
where (mb_id='$member[mb_id]' or wr_link1 = '$member[mb_id]')
and DATE_FORMAT(rvdate,'%y') = '$chkyear'
ORDER BY rvdate, rvtime asc");
위 쿼리문에서요
mb_id='$member[mb_id]' 일때는 해당되는 것은 모두 출력하구요.
wr_link1 = '$member[mb_id]' 일때는 중복되는건 생략하고 하나만 출력(group by) 해야 하거든요.
이런경우도 쿼리가 가능할까요?
꼭 필요하거든요.. 고수님들 알려주세요..
답변 1개 / 댓글 1개
채택된 답변
+20 포인트
2021-05-05 (수) 02:06:10
"(select * from $reser_table where (mb_id='$member[mb_id]' and DATE_FORMAT(rvdate,'%y') = '$chkyear' ORDER BY rvdate, rvtime asc) uion
(select * from $reser_table where wr_link1 = '$member[mb_id]' limit 1 )
답변에 대한 댓글 1개
2021-05-05 (수) 09:43:18
답변을 작성하려면 로그인이 필요합니다.
많은 도움 주셔서 대단히 감사드립니다..