Kanime Hinyemata
Kanime Hinyemata

Reputation: 23

SQL Query for filtering on 3 conditions

I am new to SQL and I have a MS-Access database where I want to filter all the data on three types of conditions.

The goal should be a query which fits any of the possible combinations - f.e.: "Information Technology" -> "Telecommunications" -> "MedTech, InsurTech, FinTech, Infra".

The name of the table is mytable.

I am thankful for any help. :)

Upvotes: 1

Views: 530

Answers (2)

Gordon Linoff
Gordon Linoff

Reputation: 1269463

In MS Access the syntax would look like:

select *
from mytable
where [Range-1] in ("Information Technology") and
      [Range-2] in ("Cyber Companies", "Telecommunications", "Robotics") and
      [Range-3] in ("Insurance, Tech", "Fiber, Optics, Silicon Valley", "MedTech, 
InsurTech, FinTech, Infra")

Upvotes: 1

Jim Macaulay
Jim Macaulay

Reputation: 5141

Try below condition.

where Range-1 in ('Information Technology')
and Range-2 in ('Cyber Companies' , 'Telecommunications' , 'Robotics')
and Range-3 in ('Insurance, Tech' , 'Fiber, Optics, Silicon Valley' , 'MedTech, 
InsurTech, FinTech, Infra'.
)

Upvotes: 1

Related Questions