use tempdb

go

 

declare @num int

set @num = 10

 

-- 조건처리

if @num % 2 = 0

       Select '짝수'

else

       Select '홀수'

go

 

Declare @Data Int

Set @Data = 10

If @Data % 2 <> 0

Begin

       Select '홀수'

       Print '홀수'

End

Else

Begin

       Select '짝수'

       Print '짝수'

End


'.NET프로그래밍 > SQL Server 2008' 카테고리의 다른 글

21. 테이블제약조건  (0) 2009.09.11
20. 제어문 - while문  (0) 2009.09.11
18. 연산자  (0) 2009.09.11
17. 변수(Variable)  (0) 2009.09.11
16. SQL서버의 데이터형식  (0) 2009.09.11
Posted by holland14
: