Learning to code in SQL: The basics explained, learning by coding yourself! by Ponte Marius

Learning to code in SQL: The basics explained, learning by coding yourself! by Ponte Marius

Author:Ponte, Marius [Ponte, Marius]
Language: eng
Format: azw3
Published: 2018-12-14T16:00:00+00:00


Good to know that person with id 2 is no longer missing. We added a where clause in the select statement from the transaction table.

Now that we have seen the working of ‘in’ and ‘not in’, let’s look at another way of working. Let’s check for existence. So the equivalent of the first query, where we use ‘in’, would be this one:

When you use exists, the second select statement checks for existence, therefore you can type in anything after the select keyword, in this case I chose select *. The syntax can be somewhat more confusing, but we are selecting all persons where the personid also exists in the transactions table. The equivalent of the ‘not in’ query would be this one:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.