Hi,
I want the db to return records which have either "bmw" or "audi". Below is my code but the db only shows records which have bmw.

SELECT * FROM `details` WHERE BRAND = 'bmw' OR 'audi'

Thank you in advance.

Cheers,
Vishal

Recommended Answers

All 2 Replies

SELECT *
FROM details
WHERE BRAND IN('bmw', 'audi')

Alternatively you can say WHERE BRAND = 'bmw' OR BRAND = 'audi'

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.