Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Using INTERSECT??
Wed, Jul 5 2023 2:04 AMPermanent Link

Ian Branch

Avatar

Hi Guys,
Can someone show me a small, practical example of using INTERSECT please?

Regards & TIA,
Ian
Wed, Jul 5 2023 10:08 AMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Ian,

SELECT ID FROM Tbl1
INTERSECT
SELECT ID FROM Tbl2

Will give a result set where the same ID values exists in both Tbl1 and Tbl2.

Example:
  Source table values:
    Tbl1.ID: 1,5,8,9
    Tbl2.ID: 5,5,0,3,9

  Result.ID: 5,9
 
 
--
Fernando Dias
[Team Elevate]
Image