Re: Help with ORDER BY using two colomns [ solved thankyou :) ]

2008-04-08 Thread Richard
Yes that would be easier, except that I would still have to create a tempory table to add 10 days onto the ones which have a status waiting for answer from customer and have not been answered for more than 10 days. This system is for customers who do not have an account yet to contact me. And

Re: Help with ORDER BY using two colomns [ solved thankyou :) ]

2008-04-08 Thread Ben Clewett
Richard, The query I gave you required the column 'o' to be calculated for each row at the time of gathering the data. When all rows have been gathered, the data will be stored and sorted in a temporary table. This temporary table will be in memory or on disk depending on the setting of the

Re: Help with ORDER BY using two colomns [ solved thankyou :) ]

2008-04-08 Thread Andy Wallace
Not sure, but perhaps an even simpler method would be to consider the initial insert an update as well... so the update column would always have a value. Then the sort would (I believe) always be in the order you want, and if you need to differentiate between rows that are new vs rows that are upd

Re: Help with ORDER BY using two colomns [ solved thankyou :) ]

2008-04-08 Thread Richard
Thanks, This is for the unanswered list of questions, so the output list (not the list stored in the mysql database) should never go over 100. by scalable, do you mean alot of ressources being used or a long wait for the answer? Because I belive I Could just use a simple limit if I needed to

Re: Help with ORDER BY using two colomns [ solved thankyou :) ]

2008-04-08 Thread Ben Clewett
Richard, No problem, glad it works. But note: this is not scalable. If you have more than a few hundred rows, you may want to think about a better solution, like storing the order field permanetly and giving it an index :) Ben Richard wrote: Thanks, it works like a charm :) Ben Clewett a

Re: Help with ORDER BY using two colomns [ solved thankyou :) ]

2008-04-08 Thread Richard
Thanks, it works like a charm :) Ben Clewett a écrit : A modification to my last email, try: SELECT *, IF(update != '', update + 10, date) AS o FROM my_table ORDER BY o DESC; +-+--++--+ | num | date | update | o| +-+--++--+ | 5 | 40 | 90