From: Andy Wallace
Date: May 12 2008 6:58pm
Subject: Re: Selecting my data first
List-Archive: http://lists.mysql.com/mysql/212755
Message-Id: <4828934A.5070905@cisdata.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
I would do something along these lines:
SELECT file_id, owner_id, (owner_id = ) as 'mine'
FROM whiles
WHERE blah blah
ORDER BY mine, file_id
Jake Conk wrote:
> Hello,
>
> I have a table with 2 columns, file_id and owner_id. I want to select
> all the files and order by file_id but I want the ones that belong to
> me to show up first then everyone elses. Is this possible and how?
>
> This is what I'm trying to accomplish:
>
> SELECT * FROM whiles WHERE owner_id= first THEN SELECT * FROM
> files ORDER by file_id
>
> I would suspect this can be accomplished by a sub query somehow but I
> don't know how.
>
> Thanks,
> - Jake
>
--
Andy Wallace - CISData - IDX Slave
AIM: acmwallace awallace@stripped