|
<< Click to Display Table of Contents >> Boolean values |
![]() ![]()
|
The BOOLEAN literal values TRUE and FALSE may be represented in loal SQL statements with or without quotation marks and the tokens are not case-sensitive.
SELECT *
FROM Transfers
WHERE (Paid = TRUE) AND NOT (Incomplete = "False")
Values of type BOOLEAN may be typecast using the CAST function to other data types. Typecast as INTEGER, TRUE values are converted to 1s (ones), FALSE values to 0s (zeros), and NULL values remain NULL. Typecast as CHAR, TRUE values are converted to T, FALSE values to F, and NULL values remain NULL.
BOOLEAN literals can also be expressed directly as "T" (for TRUE) or "F" (for FALSE). When using this convention, the quotation marks are mandatory.
SELECT *
FROM Transfers
WHERE (Paid = "T") AND NOT (Incomplete = "F")