Skip to content

Confused with Join logic

I find it so confused that my simple logic doesn’t work. I have a data with 2 columns ID and code. 1 ID can link to multiple code. So the sample data is like this: The rule is that: Find ID that has code = 1 AND code not equal to 2 AND code =3 So clearly a is fail,

Update records in table from CTE results

I want to update the records in my table using CTE. And I’ve been trying with the insert function using CTE and it’s working. This is my query with the insert function: How to change that with the update function? i want to change to update function because when i use insert function,the previous …