Hello folks,

can anybody share there expertise in SQL syntax  to help me with the
following ..



 $SQL = " SELECT * FROM quotes,details
                    WHERE details.id = quotes.relID
                     AND  relID='$sess_id'
                      AND ($sess_initial_status)
                       AND quotes.notes LIKE '%$sess_quotes_search%'

                 ORDER BY '$sess_quotes_search_by'
                      $inclination, quote_id DESC        ";


the following sql represents a join of two tables using keys

the quotes table contains a field status of type enum with the following
options ..       active,dead,live,prequote and won


$sess_quotes_search_by is a particular field in table details


what i would like to acheive is BEFORE doing the ORDER BY
i would like to sort the records into two blocks based on whether the field
status is DEAD . The records containing DEAD will occur in the bottom block.
Then further ordering will occur in these blocks.Can this be acheived using
1 SQL query ?

Many thanks

Paul




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to