[Koha-devel] SQL Query not equal and NULL

Campbell, Colin colin.campbell at ptfs-europe.com
Thu Nov 5 15:49:49 CET 2020


I think col != value is the most common. I'm wary of more convoluted
conditions like not(col = value) as when reading code it makes you wonder
if the original author thought it did some extra magic.

On Thu, 5 Nov 2020 at 14:35, Fridolin SOMERS <fridolin.somers at biblibre.com>
wrote:

> Hi,
>
>  From :
> https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24379#c1
>
>  > This query does not return rows where login_attempts IS NULL. It will
> return accounts where login_attempts = 0
>
> I only recently understood the behavior or NULL values in SQL queries
> for NOT IN and !=.
>
> Should be advice this in coding guide lines ?
> Is there a syntax better than another : col!=value / not(col=value) ?
>
> Best regards 🎃
>
> --
> Fridolin SOMERS <fridolin.somers at biblibre.com>
> Software and system maintainer 🦄
> BibLibre, France
> _______________________________________________
> Koha-devel mailing list
> Koha-devel at lists.koha-community.org
> https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : http://www.koha-community.org/
> git : http://git.koha-community.org/
> bugs : http://bugs.koha-community.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20201105/09dda19e/attachment.htm>


More information about the Koha-devel mailing list