I have a table like this:
+-------------------+---------------+
| description | colour |
+-------------------+---------------+
| Macrame Dress | Washed Black |
| Darcelle Gilet | Dirty Shellac |
| Darcelle Cardigan | Washed Black |
| Let It Rot Vest | Optic White |
| Let It Rot Crew | Washed Black |
| Let It Rot Crew | Optic White |
| Battalion Short | Somme |
| Seine Dress | Washed Black |
| Seine Dress | Cocomotion |
| Odette V-neck | Linen Marl |
+-------------------+---------------+
I want to find it for a black dress, and it returns lines 1 and 8. If I type black, it will return lines 1, 3, 5 and 8. The dress should return lines 1, 8 and 9.Can anyone think of a really elegant, beautiful sql bit that will accept any number of search words and return the most concise result. I can come up with some pretty ugly ways to do this, but they upset my karma.
stuart
source
share