469,917 Members | 1,862 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,917 developers. It's quick & easy.

SQL order by only for non empty fields

4
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
Jun 26 '07 #1
1 1534
r035198x
13,262 8TB
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
Why not just use two separate queries to get the data?
Jun 26 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by johnny | last post: by
1 post views Thread by shank | last post: by
1 post views Thread by Mike P | last post: by
16 posts views Thread by mdh | last post: by
6 posts views Thread by Index | last post: by
6 posts views Thread by GrispernMix | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.