SQL 전후 상쇄, 누적 구 화, 다 중 줄 통합
503 단어 데이터 뱅 크
with tb as(
select 1 id,25 qty
union all select 2,30
union all select 3,67
union all select 4,17
)
전후 상쇄
select *,(select a.qty-b.qty from tb b where a.id=b.id+1)
from tb a
반복 해서 화 해 를 구하 다.
select *,(select sum(qty) from tb b where b.id<=a.id)
from tb a
다 중 병합
select stuff((select ','+cast(qty as varchar) from tb order by qty for xml path('')),1,1,'')
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
nginx websocket ip_해시 규칙프로젝트 를 다운로드 한 후 서로 다른 네트워크 에 각각 이 demo 프로젝트 를 배치 합 니 다. 프로젝트 에서 환경 변수 에 따라 시스템 변 수 를 설정 합 니 다. spring.profiles.active=de...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.