Tuesday, March 15, 2016

OK, I have never heard of these subquery commands - Exists, All, Not Exists

Peter Vogel writes A subquery is literally a query within a query. Using subqueries allows you to perform some action using another query as part of your Where clause.

I personally have used subqueries many many times but just about always I use the In clause. Stumbling on this 1997 article, I realise that I may have missed some opportunities along the way. Though when I tried to work out where I would use the Exists and Not Exists clauses in my solutions, I drew a blank :(  


A simple subquery in design mode


2 comments:

grovelli said...

In the From Garry section, ChargeRate turned to eRate

Garry Robinson said...

In my system it is erate, just thought Chargerate was a better idea in the description (at the very last minute).