N1QL query suggestion needed

n1ql
query

#1

Hi Good Day,

I am running following query for update the multiple rows with multiple where clauses. Can you correct me, if i did mistake anywhere?

UPDATE tbl SET
pr = CASE
WHEN (uni = ‘000000000021’ AND cid = ‘100021’) THEN ‘211.22’
WHEN (uni = ‘000000000020’ AND cid = ‘100021’) THEN ‘20.31’
ELSE pr
END
where type = “str” AND uni IN (‘000000000021’, ‘000000000020’) AND cid IN (‘100021’, ‘100021’)
RETURNING tbl.pr, tbl.uni


#2
UPDATE tbl SET pr = CASE
                    WHEN (uni = "000000000021" AND cid = "100021") THEN "211.22"
                    WHEN (uni = "000000000020" AND cid = "100021") THEN "20.31"
                    ELSE pr
                    END
WHERE type = "str" AND ((uni = "000000000021" AND cid = "100021") OR (uni = "000000000020" AND cid = "100021"))
RETURNING tbl.pr, tbl.uni;

#3

Thank you, It is working great.