I have three tables kinda like the example below:
TABLE
CARS
carId carName
----- --------
1 a
2 a
3 b
4 b
5 b
6 c
7 d
8 e
9 f
10 g
TABLE
CAR NAMES
nameId carName
------ -------
1 a
2 b
3 c
4 d
5 e
6 f
7 g
TABLE
CAR ATTRIBUTES
nameId attribute
------ ---------
1 FAST
1 SMALL
1 SHINY
2 BIG
2 SLOW
3 EXPENSIVE
4 SHINY
5 FAST
5 SMALL
6 FAST
7 SMALL
I have been trying to put together a query to get the carId where it has attributes of both FAST and SMALL, but have been having no luck. What is the best way to do this?
In this example the result would be carID 1 and carName a where attribute = SMALL and attribute = FAST
Looking for something like this?
(untested)