1

I have read that update joins in SQLite are not supported, is there a way to convert a SQL update to SQLite?

Update Items
    Set Monitored = '1'

from Items
left join ItemsLoc on ItemsLoc.ItemId = Item.Id

where ItemsLoc.Loc is null

I am looking to update a column from Items table where the table/column ItemsLoc.Loc has a null value

2 Answers 2

0

Looks like I figured it out.

Update Items
Set Monitored ='1'
Where Items.Id in (Select Items.Id from Items Left Join ItemsLoc on ItemsLoc.ItemID = Items.Id where ItemsLoc.Loc is null)
1
  • 1
    then accept the answer
    – nbk
    Commented Aug 3, 2020 at 18:21
0

If ItemsLoc.Loc is not nullable then

UPDATE Items
SET Monitored = '1'
WHERE NOT EXISTS ( SELECT NULL
                   FROM ItemsLoc 
                   WHERE ItemsLoc.ItemId = Item.Id )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.