그냥 데이터베이스에서 마지막 데이터를 가져 오기 위해 MS SQL 문을 작성하려고합니다. 불행히도 거기에 DESC LIMIT 1을 추가하면 나에게 잘 보이는 것처럼 보이지만 잘못된 구문이 표시됩니다.MS SQL 마지막 레코드
더 많은 기술을 가진 사람이 그것을 볼 수 있습니까? 본이 작업 LIKE
Select
sum(spareparts),
month(calculationdate)
from cz_axnmrs_calculations
where CASE_ID in (select case_id
from cz_axnmrs_cases
where insurer_memberid = 'MM-O-5B57274F')
and YEAR(calculationdate)='2014'
group by month(calculationdate) DESC LIMIT 1
:
Select
sum(spareparts),
month(calculationdate)
from cz_axnmrs_calculations
where CASE_ID in (select case_id
from cz_axnmrs_cases
where insurer_memberid = 'MM-O-5B57274F')
and YEAR(calculationdate)='2014'
group by month(calculationdate)
@Matt : 게시물을 편집하는 경우 모든 사항을 수정해야합니다. 편집 - 검토 자의 시간을 소중히 여깁니다. –
"내가보기 엔 귀찮은 구문을 완전히 무시하는 것"처럼 "나에게 도움이 되는가?" – TomTom
@juergend Yeh 죄송합니다, 일반 텍스트를 놓쳤습니다. 코드를 정리하고 질문에 먼저 대답하고 싶습니다. – Matt