1
Answer

SQL order by only for non empty fields

Photo of ofek cohany

ofek cohany

18y
3.9k
1

Hi there,

I have a dating website.

When a user searches for members, I would like to display first, the ones with the photos (shuffled) and then the others (shuffled as well).

-I can't use ---WHERE(img <> '')--- because then it won't get the ones without the photo.

-If I use ORDER BY, it put them always in the same order, according to the name of the the photo.

How do I solve this one??

Thanx in advance,
Ofek

Answers (1)