Combine SQL Queries With UNION, INTERSECT, EXCEPT

preview_player
Показать описание
Step-by-step tutorial shows you how to combine your SQL queries (columns) with UNION, INTERSECT, and EXCEPT!

Queries:
1) Get the combined unique values in 2 columns: SELECT column FROM table1 UNION SELECT column FROM table 2
2) Get the unique values that are present in 2 columns: SELECT column FROM table1 INTERSECT SELECT column FROM table 2
3) Get the values that aren't present in 2 columns: SELECT column FROM table 1 EXCEPT SELECT column FROM table 2

Support the Channel:
Рекомендации по теме
Комментарии
Автор

Finally someone who simplify an explanation. I found that most IT guys try to show their flex more than teaching others and end up losing the listener completely. Thanks for being straight to the point and not over complicate things!

quintonmatthee
Автор

Very well done! Concise, to the point and no fluff. A+ 🙂

houstonfirefox
Автор

well done, I watch your videos cause they are short, explained well and make DB look easy!

mboshu
Автор

Thanks, buddy. You helped me a lot this semester.

mahdihabibi
Автор

this is perfect explanation im crying this is too good to be real, thank you

noxzzza
Автор

I just found your channel now, too bad you don't upload new videos any more. You explained these queries very well. I'll definitely watch more of your videos.

PEdulis
Автор

thank you your channel is helping me so much in university !

aaronmubiru
Автор

Thanks man, I'm working and taking a course of SQL (I use it at work) and this class cause me a little confusion about how to use it

nikobellic
Автор

very clear tutorials thanks so much. would have enjoyed if you could give some practice q's to help us reinforce learning ! this is much clearer than another tutorial course i paid for (i came on here was was confused and your vid made it very easy to understand.thanks so much

summer
Автор

i really love your videos, it's helping me to understand the sql. simple and very clear, thankssss:)))

afifahfebriswariismadewi
Автор

wayyy better than my teacher! thanks for the video4

gamecuber
Автор

Thank you for the video. Please do upload more :) :).

VaaniMogan
Автор

Hi from Brazil! Thank u very much man!!

netim
Автор

i watch your videos about cryptocurrency when i was trying to learn what DeFi is. Now you're on my field too! Thats pretty cool!

rvrak
Автор

The 'except' cannot be found in suggested commands. I use xampp. Is xampp lack something?

francisestillore
Автор

Great job!
Would be good if you elaborate a bit more on the logic behind the results at some points like "the except all here would bring back all the countries that are within customers, as many times as it appears there (the duplicates) and as long as it does not appear in the suppliers table" - something like that...

When you say "countries that aren't in both tables", it is vague - try to be specific. great job tho

OmerBen-Ami
Автор

Just a question: what would we do if we need to the union all for two tables and then save it as a new table. For example 1 union 2 makes a new table 3. what would be the command for it.

nkhan
Автор

I have a large table. I want to retrieve ALL the records that have duplicates in the name field. So if John Smith appears once in the table then I want to exclude him completely from the result. I am not interested in anyone who only showed up one time. But if he appears more than once (let's say 7 times) in the table then I want ALL 7 of his records shown. And the same for Mike Jones and Amanda Brown and everyone else. I am only interested in those who appear more than once, and then, I want to see ALL the records they appear in, since the different fields have additional info about those people. Can you show me how to write such a query? Thanks!

rainbowclouds
Автор

hey :)
i really love ur videos...currently, i'm taking a course about database development, basically, i'm learning it from 0 so from the most simple SELECT statement...i think my course is horrible, very hard to follow for someone like me who doesn't have any kind of IT knowledge whatsoever and ur videos are helping me a lot clear up the ppt-s i see in class.
near that it's hard to follow the presentations, we make very little practice so i have very little idea if i can use what i learn or not...could u pls recommend me some website (free or with a subscription) where i can practice sql/mssql? cuz like with UNION or EXCEPT, i understand the idea and logic of this statement but i have no idea if i could actually use/recognize them in an exercise.
thanks in advance.
Agnes

buksi
Автор

Why do we even go to school and pay a lot of money anymore?

pradiptahafid