I have a table full of songs per album:
'songs' Table:
+---------+----------+-----------+-----------+-----+-----------+-------------+
| NAME | SONG01 | SONG02 | SONG03 | . . . | SONG32 | SONG33 |
+---------+----------+-----------+-----------+-----+-----------+-------------+
|ALBUM1|A1SONG1|A1SONG2|A1SONG3| . . . | NULL | NULL |
|ALBUM2|A2SONG1|A2SONG2|A2SONG3| . . . |A2SONG32| NULL |
|ALBUM3|A3SONG1|A3SONG2|A3SONG3| . . . |A3SONG32|A2SONG33|
+---------+----------+-----------+-----------+-----+-----------+-------------+
How would I select ONLY the songs that have values per row?
This makes sense, but doesn't work:
I dont want to go thru for each field:
Any help?
TYIA!
'songs' Table:
+---------+----------+-----------+-----------+-----+-----------+-------------+
| NAME | SONG01 | SONG02 | SONG03 | . . . | SONG32 | SONG33 |
+---------+----------+-----------+-----------+-----+-----------+-------------+
|ALBUM1|A1SONG1|A1SONG2|A1SONG3| . . . | NULL | NULL |
|ALBUM2|A2SONG1|A2SONG2|A2SONG3| . . . |A2SONG32| NULL |
|ALBUM3|A3SONG1|A3SONG2|A3SONG3| . . . |A3SONG32|A2SONG33|
+---------+----------+-----------+-----------+-----+-----------+-------------+
How would I select ONLY the songs that have values per row?
This makes sense, but doesn't work:
Code:
SELECT *
FROM songs
WHERE songs.* IS NOT NULL
I dont want to go thru for each field:
Code:
WHERE song01 IS NOT NULL AND
song02 IS NOT NULL AND
song03 IS NOT NULL AND
. . .
song32 IS NOT NULL AND
song33 IS NOT NULL
Any help?
TYIA!