Re: Help with ORDER BY using two colomns

2008-04-08 Thread Kristian Myllymäki
mysql version? http://dev.mysql.com/doc/refman/5.0/en/case-statement.html order by case when updated is not null then updated else created end desc; /Kristian On Tue, Apr 8, 2008 at 1:04 PM, Richard [EMAIL PROTECTED] wrote: Hello, I've got a table which containes two date colomns. The

Re: index, unique index question

2007-08-14 Thread Kristian Myllymäki
A composite index on both columns may be used by queries involving either both columns, or the first column in the index. http://dev.mysql.com/doc/refman/5.0/en/multiple-column-indexes.html So, an index on (receiver_id, sender_id) may be used by predicates on both columns or receiver_id