나는 정말 sqlserver의 초보자입니다.
데이터베이스에서 일부 데이터를 쿼리하고 있으며 결과와 함께 null 값도 반환됩니다.
내 질문은 다음과 같습니다.
select amount, distributorid from paymants
일부 유통 업체가 null values
에서 amount column
.
도와주세요!
감사
null 값을 필터링 하려면 is null
(또는 is not null
)을 사용해야 합니다.
select amount, distributorid
from paymants
where amount is not null
다른 값 (예 : -1)이있는 null 금액이있는 모든 레코드가 필요한 경우 isnull
또는 coalesce
아래와 같이 사용할 수 있습니다 .
select coalesce(amount,-1) amount, distributorid
from paymants
또는 amount null 레코드 만 필요한 경우 할 수 있습니다.
select amount, distributorid
from paymants
where amount is null
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다