ITmembers.net 아카이브 · 2002–2009

질문과 답변

쿼리 질문입니다 mysql

select max(no) as no from bbs where no <= 4000
union
select min(no) as no from bbs where no >= 6000
order by no desc
+------+
| no     |
+------+
|6000   |
| 4000  |
+------+
이런식으로 되어있는 쿼리에다 title정보까지 뽑아오고 싶은데 어떻게 해야하나요
select max(no) as no,title from bbs where no <= 4000
union
select min(no) as no,title from bbs where no >= 6000
order by no desc

ERROR 1140: Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP columns is illegal if there is no GROUP BY clause                                    

서브쿼리를 사용하고 싶지만 4.0버전이라 지원이 안됩니다

댓글 2