Table 'anbieter' looks like :
Firma | Blumenerde | Dachsubstrate | Rinden | Substrate
-------------------------------------------------------------
Name 1 | | x | |
Name 2 | x | | x |
Name 3 | x | x | x |
Name 4 | | x | |
What I need to do is:
Output Names (First Column) and select all Columns header which are NOT NULL and not empty ('')
For Example
Name 1 / Dachsubstrate
Name 2 / Blumenerde / Rinde
....
I tried the following:
SELECT * FROM anbieter WHERE Blumenerde IS NOT NULL AND TRIM(Blumenerde) <> ''
This works great with one column... But I need to make it work with some more columns like:
SELECT * FROM anbieter WHERE (Dachsubstrate OR Blumenerde) IS NOT NULL AND TRIM( ????? ) <> '';
How to "TRIM()" them ?
Hope you understand my point...