728x90
반응형
<SQL>
select * from (select a.*, rowNum rn, nickname from(select * from reply where del='n' order by re_no desc )a ,member m where a.m_id = m.m_id );
<오류발생>
프로젝트 중 조인문을 실행하였는데, 분명 order by re_no desc 를 해주었는데 오름차순으로 결과가 정렬되는 것이었다.
검색했는데도 못찾았고, 아래 where a.m_id = m.m_id 의 순서를 where m.m_id = a.m_id 로 바꾸어주니까 내림차순으로 다시 정렬되었다.....
근데 다시 where a.m_id = m.m_id 로 바꿔봤는데 내림차순으로 잘 정렬되어서 결과가 출력됐다.
뭐가문제일까....
근데 처음에는 조인을 하게되고 where절을 실행하면서 처음에 문제가 생겼던것은 맞는거같다.검색했을 때 관련된 정보가 없어서 글을 올려본다..
728x90
반응형
'Error' 카테고리의 다른 글
[Error]nested exception is java.io.FileNotFoundException: class path resource [api.properties] cannot be opened because it does not exist (0) | 2022.01.19 |
---|---|
[jQuery] $post 로 값넘기기 (0) | 2022.01.18 |
[Spring] PropertyNotFoundException 에러 (0) | 2022.01.12 |
[Mybatis] java.lang.IllegalArgumentException 에러 (0) | 2022.01.11 |
[Mybatis] PersistenceException 오류해결 (0) | 2022.01.09 |