Path: csiph.com!usenet.pasdenom.info!news.albasani.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Date: Sun, 04 Aug 2013 20:20:52 +0200 From: Luuk User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 Newsgroups: comp.lang.php,alt.php Subject: Re: sql order but move some rows bottom References: <1qthmi1tu68bo$.9vs28kns3wda.dlg@40tude.net> <13413lih7j7xy.ntybohdhh9wy.dlg@40tude.net> <19m253q4wpnqg.3aexf4o8h0ae$.dlg@40tude.net> <1l02da-q4u.ln1@luuk.invalid.lan> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <2li2da-282.ln1@luuk.invalid.lan> Lines: 31 NNTP-Posting-Host: 2001:980:9089:1:1485:831:d105:93a6 X-Trace: 1375641001 news.xs4all.nl 15943 [2001:980:9089:1:1485:831:d105:93a6]:44537 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.php:10396 On 04-08-2013 19:53, nawfer wrote: > Il Sun, 04 Aug 2013 19:37:32 +0200, Luuk ha scritto: > >> On 04-08-2013 17:49, nawfer wrote: >>>> y before 100: >>>> ORDER BY >>>> (CASE WHEN column2 = 100 THEN 2 ELSE 0 END + CASE WHEN column3='Y' THEN >>>> 1 ELSE 0 END) ASC, column1 ASC, column2 ASC >>> >>> small curiosity >>> the above code respect at a simple order >>> >>> ORDER BY column1 ASC, column2 ASC >>> >>> >>> change the performance (example - 5%)or is insignificant the difference? >>> >> >> >> Sorry, my English is not good enough to understand what you mean ..... >> Could you rephrase the question? > > I ask if the code you post me for does order taht is more complex than a > simple order by make slow the query ; is more slow of 5% 10% or more? > Yes, its slower, but i dont not know how much slower. With a couple of records you will not notice the difference, but with 'a lot of records'* you might notice some delay ;) *) 'a lot of records' is not defined here ;)