Using comparison operators in SELECT clause of T-SQL query
-
22-09-2019 - |
문제
How to select a result of comparison operator as a field with type BIT?
How it does work in C#
:
bool isGreater = FieldA > FieldB;
How it doesn't work in T-SQL
:
SELECT (FieldA > FieldB) AS BIT FROM t
How to write such task properly?
해결책
You should use CASE clause:
CASE
WHEN FieldA > FieldB THEN 1
ELSE 0
END AS [BIT]
다른 팁
이 코드를 제 3 레이어에도 사용하십시오.
myImage.RelativeVertical = RelativeVertical.Page;
myImage.RelativeHorizontal = RelativeHorizontal.Page;
.
3 레이어 그림의 절대 위치를 계산합니다.
제휴하지 않습니다 StackOverflow