emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finally figuring out some ob-sqlite stuff -- for worg?


From: Stefan Nobis
Subject: Re: Finally figuring out some ob-sqlite stuff -- for worg?
Date: Sat, 09 Nov 2019 18:28:32 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (darwin)

Eric Abrahamsen <address@hidden> writes:

> Okay, it's up. If anyone wants to explain to me the point of the
> "where exists" clause in the SQL, I would be interested to hear. It
> works as expected this way, but is that clause necessary?

Yes, very necessary. Without it, all ratings would be changed - the
two example rows without ratings (ids 5 and 12) would get the values
from the intermediary org table, every other row in table bookreview
would get its rating attribute set to null (because there is no
matching entry in the temporary updates table).

Remember: update without a where clause always touches every single
row of the complete table.

The "where exists" clause ensures that only those rows of bookreviews
are touched that are present in the intermediary org table. If you do
not like "where exists" you could say "where bookreview.id in (select
id from udpates)".

-- 
Until the next mail...,
Stefan.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]