table에 1 2 3 4 5 까지의 데이타 있습니다 select SEQ from table_name order by SEQ limit 1; 이 라인은 TABLE의 처음 행을 가져오고요 츨력은 "1" select SEQ from table_name order by SEQ desc limit 1: 이 라인은 TABLE의 마지막 행을 가져옴니다 출력은 "5" 이 두 쿼리를 하나로 어떻게 묶죠?
select SEQ
from table_name
where SEQ = (select min(SEQ) from table_name )
or SEQ = (select max(SEQ) from table_name )
감사합니다 여기에서 select count(SEQ) from table_name where SEQ > 2 and SEQ < 4 카운트 구하는 쿼리문을 더 할 수있는지요?
어떤용도인지 몰겠지만.... select min(SEQ) ,max(SEQ) ,sum(case when SEQ > 2 and SEQ < 4 then 1 else 0 end) from table_name .. 한줄에 다나옴.
정말 감사합니다 MYSQL이 이런 좋은 기능과 쿼리문이 있었다는걸 알았네요. 행복하세요