Weblog @ rebex.cz

Weblogy na webu Rebexu
Welcome to Weblog @ rebex.cz Sign in | Help
in Search

Weblog @ Rebex.cz :: Honza Šotola

nepravidelné poznámky .NET vývojáře

Porovnání dvou SQL tabulek pomocí jednoho řádku v T-SQL

Potkal jsem článek o velmi elegantním způsobu, jak porovnat obsah dvou SQL tabulek v MS SQL Serveru 2005.

Využívá klíčových slov EXCEPT INTERSECT, která jistě každý zná...
...až nás pár opozdilců, s nimiž se o tuto informaci rád podělím:

Např. následující dotaz

select * from table1 except select * from table2

vypíše všechny řádky z table1, které se neshodují s žádným řádkem table2


select * from table1 intersect select * from table2

vypíše všechny řádky z table1, pro které je nějaký totožný řádek v table2.

Samozřejmě kombinovat oba přístupy, používat omezený výčet sloupců apod.

Jinými slovy zmíněná dvě klíčová slova přináší příjemné rozšíření fráze IN,  která pracuje jen nad jedním sloupcem
(což lze samozřejmě použít i k jiným věcem, než porovánvání dvou tabulek)

Published 23. září 2008 20:29 by honzas
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS



mirab said:

Potřeboval bych poradit, jak porovnat dva stavy jedné tabulky. Tabulku každou noc vymažu a znovu naplním, ale bylo by efektivnější provádět to pouze v případě, že došlo k nějaké změně.

Díky za nějaký nápad

dubna 29, 2009 15:15

Merrill said:

TRM Filtration, the world’s most popular filtering product

producers, has earned its popularity for extraordinary environment pollution handling, waste treatment and even giving fresh air.

For 4 decades, we have been able to enhance global comfort as well as performance by revolutionary products and solutions.

TRM has got better ease as well as efficiency around the globe

by its cutting-edge products and most dependable

support for 4 decades. TRM air filtering equipments are supplied everywhere in the United States as well as 6 other foreign states.

Also, our filtering adventure covers various kinds of

fields just like pottery, woods, cloth, pharmaceutical, synthetics,

paper, fibreglasses, corrugated, as well as silicone.

For sure, we'll enhance well-being as well as wellness by delivering safe

and fresh air by our globally recognized


Also, TRM Filtration stands out as a OEM (original

equipment manufacturer) to TRM Filter systems.

All these air filters are implemented for a number of fields with different configurations.

The TRM filters have maximum quality and lower air to cloth percentage.

These are typically environment-friendly and removing about 99.9 percent of airborne toxins.

srpna 1, 2014 8:21

McCrea said:

This can lead your regular smoking habit over without

any certain side-effects and long run measures as you can easily switch to smokeless, toxic gases free E

cigarette andd preevent more passive smokers and even save yourself from breaking law because of smoking.

It still contains nicotine mist to taste like

real cigarette without dreaded carcinogens. Many manufacturers continuously innovate on their merchandise styles that mean you will

always get a new design features or new features in your electronic cigarettes.

září 19, 2014 0:47

Ingrid said:

I can't bear reading lengthy articles, only as i have got some

dislexia, but i actually liked this one

ledna 11, 2015 13:15

Kami said:

Lovely website, it loads genuinely quick and appears really cool.

ledna 17, 2015 6:09

Margareta said:

Hi mates, its great article concerning tutoringand completely explained, keep it up all the time.

května 1, 2015 5:20

Moja Stronka said:

Pіęknie, dziękuję!

června 4, 2016 17:40

νοσος κροουν said:

Everything is very open with a clear clarification of the issues.

It was definitely informative. Yoour website iss useful.

Manyy thanks for sharing!

ledna 30, 2017 23:47

Hollie said:

Additionally, browse the merchandise explanation furnished in their site to know the product quality

amount of the item you are committing on.

srpna 9, 2017 12:56

kepago said:

Thanks for a marvelous posting! I actually enjoyed reading it, you're a great author.I

will ensure that I bookmark your blog and may come back

down the road. I want to encourage you to ultimately continue your great job, have a nice holiday


srpna 30, 2017 4:04

διαιτα express said:

Hey! I could have sworn I've been to this website before but after

checking through sokme of the post I realized it's new to me.

Nonetheless, I'm definitely glad I found it and I'll be bookmarking and checking back frequently!

října 17, 2017 0:47

dream said:

What i don't realize is if truth be told how you're now not actually

much more neatly-liked than you might be now. You are so intelligent.

You recognize therefore significantly relating to this topic, made me in my opinion believe it from a lot of numerous

angles. Its like men and women are not fascinated

unless it is one thing to accomplish with Woman gaga!

Your personal stuffs great. All the time handle

it up!

prosince 12, 2017 17:28

information said:

Wrought metal chairs with upholstered backs are

current regarding style, so you might be thinking about buying those invoved

with a complete set.  Geet more information about warranties,

installation, and service contracts.  Well,

budget decorating doesn't have to be that cheap when you're

seeking a true decorating solution too get a long-term home nevertheless, you just don't possess the finances for

your highest pricd decorating.

května 31, 2018 12:56

http://rvhmu94r23.litebox-5.ru said:

října 24, 2018 13:00

washington wedding dj said:

If you are carrying out a second marriage, you will need proof that you will be ree from a marriage.

Step 3 Don't spend your time foor the tiny problems and perform essential thingfs forst -

There are so many stuff that should be ddone throuhghout the

next several months off one's life. The Unity Candle Ceremony symbolizes tthe transformation of

ttwo separate people joining together as one.

listopadu 18, 2018 15:37

Missoula Wedding Dj said:

If genyinely want to have a wedding during the winter, you might like to

stay away from Calla lilies and orchids.  Table linens

needs tto be based for the character you have chosen or

particular part of Disney. The Unity Candle Ceremony symbolizes the ransformation of

two separate people joining together aas one.

prosince 21, 2018 5:06

mua đồ gỗ cũ tỉnh Thái Bình said:

Chúng tôi luôn cam kết mua với giá cao nhất.

ledna 30, 2019 14:35

Leave a Comment

Powered by Community Server (Personal Edition), by Telligent Systems