The “In” keyword can be used in place of the equal sign (=), in the “Where” clause.

This is when you want to get a list of thing. Or exclude a list of things.

An example of this I code:

— Example of list to include:

Select

*

From

Table1 T1

Inner Join Table2 T2 On T1.T1ID = T2.T1ID

Where

T1.Relation In (‘Sibling’, ‘Mother’, ‘Father’)

— Example of list excluded:

Select

*

From

Table1 T1

Inner Join Table2 T2 On T1.T1ID = T2.T1ID

Where

T1.Relation Not In (‘Uncle’, ‘Aunt’, ‘Cousin’)

Advertisements