how to join two long queries from one table?
===

I have columns

    

    First name | last name | nr (individual number) | pref1 (preference1) | pref2 (preference2)| pref3(preference3) | situation | distance | sex


with 100 records in one table ap


In the results of all I can't have redundancies. It means when in first group of result I get individual number (column "nr") of fore example '2112' it can't be displayed in last one of results.

    SELECT DISTINCT nr FROM ap 

Records from first query:


    WHERE sex='F' and pref1='1' ORDER BY situation DESC, distance DESC
    AND  WHERE (sex='F' and pref2='1' and situation= ' ' ) ORDER BY distance DESC
    and WHERE (sex='F' and pref3='1' and situation= ' ' ) ORDER BY distance DESC
    LIMIT 4

Then I would like to join results from second query:

    WHERE sex='M' and pref1='2' ORDER BY situation DESC, distance DESC
    AND WHERE (sex='M' and pref2='2' and situation= ' ' ) ORDER BY distance DESC
    AND WHERE (sex='M' and pref3='2' and situation= ' ' ) ORDER BY distance DESC
    LIMIT 7

and then join to all records from last query: 



    WHERE sex='F' and pref1='3' ORDER BY situation DESC, distance DESC
    AND WHERE (sex='F' and pref2='3' and situation= ' ' ) ORDER BY distance DESC
    AND WHERE (sex='F' and pref3='3' and situation= ' ' ) ORDER BY distance DESC
    LIMIT 10



Is it possible to do?
