Post AOU2qZmSPQsOp5ftlQ by splitcells@fosstodon.org
 (DIR) More posts by splitcells@fosstodon.org
 (DIR) Post #AOTIfkmiYlf5sJhLBg by splitcells@fosstodon.org
       2022-10-11T20:11:29Z
       
       0 likes, 0 repeats
       
       Who the hell had the ********* idea to introduce `something is null` to SQL? Like... seriously?#SQL
       
 (DIR) Post #AOTIflOIJ3ifkrHLl2 by pleiades@fosstodon.org
       2022-10-11T22:29:01Z
       
       0 likes, 0 repeats
       
       @splitcells Sometimes '0' is a real value (as in 0 doctor visits in one day), and you need something else to define a register with a "no-value" value. Custom-defined symbols such as '-1' value for empty registers can work inside your specific system, but if you are importing data from other external systems things can get complicated! Especially if you work with essbase lol
       
 (DIR) Post #AOTIii6YypGuQrOH1k by pleiades@fosstodon.org
       2022-10-11T22:29:25Z
       
       0 likes, 0 repeats
       
       @splitcells Sometimes '0' is a real value (as in 0 doctor visits in one day), and you need something else to define a register with a "no-value" value. Custom-defined symbols such as '-1' value for empty registers can work inside your specific system, but if you are importing data from other external systems things can get complicated! Especially if you work with essbase lolI agree SQL is a really ugly language though.
       
 (DIR) Post #AOTPV6Hkyozx3H5F44 by meowski@fluf.club
       2022-10-11T23:45:31.273572Z
       
       0 likes, 0 repeats
       
       @pleiades @splitcells this is what NULLs are for (or false)it's not that complicated. null is no value, integer 0 is a value. you can define whether to allow null values for a column.
       
 (DIR) Post #AOU2qZmSPQsOp5ftlQ by splitcells@fosstodon.org
       2022-10-12T07:06:23Z
       
       0 likes, 0 repeats
       
       @pleiades Oh, I think we have a misunderstanding and maybe this is a speciality in MSSQL. It's not about null. Instead, it's about the `<>`, `is` and `=` operators.The following code selects 4 and 5!IF (1 <> null)BEGIN    select 1ENDIF (null <> null)BEGIN    select 2ENDIF NOT (null <> null)BEGIN    select 3ENDIF (1 <> 2)BEGIN    select 4ENDIF (null is null)BEGIN    select 5END
       
 (DIR) Post #AOU2suJ34AVb3s1xYW by splitcells@fosstodon.org
       2022-10-12T07:06:52Z
       
       0 likes, 0 repeats
       
       @pleiades Oh, I think we have a misunderstanding and maybe this is a speciality in MSSQL. It's not about null. Instead, it's about the `<>`, `is` and `=` operators functionality regarding null.The following code selects 4 and 5!IF (1 <> null)BEGIN    select 1ENDIF (null <> null)BEGIN    select 2ENDIF NOT (null <> null)BEGIN    select 3ENDIF (1 <> 2)BEGIN    select 4ENDIF (null is null)BEGIN    select 5END
       
 (DIR) Post #AOU2ux7Pa5f4MYYxY8 by splitcells@fosstodon.org
       2022-10-12T07:07:09Z
       
       0 likes, 0 repeats
       
       @pleiades Oh, I think we have a misunderstanding and maybe this is a speciality in MSSQL. It's not about null. Instead, it's about the `<>`, `is` and `=` operators functionality regarding null.The following code selects 4 and 5!IF (1 <> null)BEGIN    select 1ENDIF (null <> null)BEGIN    select 2ENDIF NOT (null <> null)BEGIN    select 3ENDIF (1 <> 2)BEGIN    select 4ENDIF (null is null)BEGIN    select 5END#SQL