Skip to content

get records that doesnt exists in another table

I have a temp table over a 1000 rows but for example purposes as follows #Table and then i have another table as follows (this is not a temp table) Compliance Table how do i check if the records from the temp table doesnt exists in the Compliance table per its ID and Code so from the above data i

Sql update query using When condition

The example below apply null values into the field nom for the others id, how can forbid this action so that it does not modify the already existing values ​​and that I do not wish to modify ? Answer One way is with else: But if you just want to update the rows that match, then use WHERE: No need

Azure SQL Server Created Date

This could be the first of many questions I raise around Azure as I am currently on a mission to tidy up our Azure platform that has previously been setup by other teams. Our SQL Servers that have been setup on Azure have had no tags setup and I want to setup some new tags now on all our existing

count() results without using group by

I am attempting something very similar to last example (Using GROUP BY) on this page: https://thecodedeveloper.com/mysql-count-function/ Referring to the following table of data: The following query: Will produce the following output: Except I want to see the number of employees in each department as well as …

SQL new table with conditions

I have a table and I want through sql to parse it into another table. The problem is that there is a condition: There are 3 columns in old version And I want to store them into new table’s column like : Thanks in advance. Answer You can use case expressions and string concatenation, like so: This uses s…

Presto – pivot table

Hi I have a table like this: I want to convert it into like this: Answer For a fixed list of properties, you can do conditional aggregation: This puts the session id in the first column and 0/1 values in each column, depending on whether the given session owns the given property. To generate the exact output …