Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query without max()
Message
From
23/09/2019 14:52:22
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
23/09/2019 13:52:08
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01670845
Message ID:
01671047
Views:
68
>>>>>They were introduced in SQL-99 - you probably blocked that memory, as this was the SQL that added official support for boolean data type - sticking it to Oracle and DB2 ;-))
>>>>
>>>>SQL Server doesn't have boolean data type either
>>>
>>>UPDATE
>>>
>>>In practise it does not matter. The bit datatype can hold only three vaues. 0, 1 and NULL, just like the boolean datatype.
>>
>>In practice it's equally useless, as you can't do anything with it - no operators work with those values. You can't say "if table1.bitfld1 OR table2.bitfld2" or any such thing - the stored values or variables with such values can't be used in boolean expressions, only in comparisons. Damn, even the 5K basic interpreter on ZX Spectrum, 36 years ago, was able to do "if x and y then".
>
>Of course there was a potential "gotcha" in BASIC as handling of booleans could vary depending on the implementation. Most would generally agree when used in branching statements that an expression that evaluates as a zero would indicate a "false", and a non-zero value would indicate "true." And as long as you used AND, OR and NOT operation on return values from boolean expression you'd get the expected result. Where you'd run into different behavior is when you use values that would be outside the values returned in a logical expression. In some implementations a "true" value would be represented by a numeric 1, and on some others a numeric -1. The latter would generally assume you're using two's complement for integer values. On some implementations the AND, OR and NOT would be bitwise operators (with the numeric being interpreted as integer) and on some others they're handled as zero or non-zero, and a few that were somewhere in between.

I know, and I saw this coming. Had trouble myself when jumping from one Basic to another. But the point here is that all those dialects, back then, HAD it. TSQL doesn't.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform