How to make a selection from Mysql according to the matching condition with one of the listed values?
For example, there is a base of machinery. The base is already done by some skilled programmer.
In one of the columns a comma separated list of machine parts: bumper, wheels, glass, exhaust pipe, etc.
Each car has their own individual set.
Machine 1: bumper, wheels, glass
Machine 2: wipers, wheels, washer
Machine 3: exhaust pipe, bumper, wheel
Machine 4: the starter, glass, wheel, pedals, gearbox
Machine 5: bumper
Now need help with a Mysql query to find cars that have bumper or wheel.
The request showed 1, 2, 3 and 5 of the machine.
Can't find the solution or come up with..
asked September 26th 19 at 07:12
The first thing that comes to mind is something like SELECT * FROM cars WHERE options LIKE %bumper% or options LIKE %wheel%
I would have 2 tables added - "view parts" and "spare car", and built them in a non-relational column. And then search and indexes - all inclusive.
PS I so understood, it does not base itself machines, and the base of what was left from cars :D
Find more questions by tags MySQL