0

Hi Everyone.

Could someone assist me in the query.
The table has type_of_vehicle field. In this field I have A, B and M.

I would like to create a query where I can specify to select A and B, or A and M or A,B,M.

Hope someone could assist me in this.

Thanks

5
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by swi2
0

Could someone assist me in the query.
The table has type_of_vehicle field. In this field I have A, B and M.
I would like to create a query where I can specify to select A and B, or A and M or A,B,M.

Your question is not clear....
What you want to do .... just give detail about that....


Highlighted should be more clear....

0

Hello,

Assuming you want all fields returned.

SELECT * FROM table
where type_of_vehicle = 'A' or type_of_vehicle = 'B'

SELECT * FROM table
where type_of_vehicle = 'A' or type_of_vehicle = 'M'

SELECT * FROM table
where type_of_vehicle IN ( 'A', 'B', 'M')

0

hi

to selected ALL

SELECT * FROM TABLENAME(YOU SPCIFY YOUR TABLE NAME)
where type_of_vehicle IN('A','B','M')

or you dirctly write this way if ther is only three field (A,B&M)

SELECT * FORM TABLE NAME

to selecte ONLY A&B

SELECT * FROM TABLENAME(YOU SPCIFY YOUR TABLE NAME)
where type_of_vehicle='A' or type_of_vehicle = 'B'


to selecte A&M

SELECT * FROM TABLENAME(YOU SPCIFY YOUR TABLE NAME)
where type_of_vehicle='A' or type_of_vehicle = 'M'

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.