sega99 Posted May 5, 2013 Report Share Posted May 5, 2013 http://paste.php.lv/05ace6228c72157ae1d8ad903d4e74c7/nonum dateadd un date ir timestamp jeb līdzīgs šim 1286895490 audi nosaukumi tiek atkārtoti 10 pēc kārtas, vienādi, taču, bmw tiek sakārtoti pareizi kas notiek ? kā to labot ? Quote Link to comment Share on other sites More sharing options...
draugz Posted May 6, 2013 Report Share Posted May 6, 2013 Jautājums, ko tu vispār vēlies panākt? atlasīt 10 audi un 10 bmw? select t1.title, t2.title FROM ( SELECT DISTINCT audi.title FROM audi ORDER BY audi.dateadded DESC ) t1, ( SELECT DISTINCT bmw.title FROM bmw ORDER BY bmw.date DESC ) t2 LIMIT 10; Iespējams šitas strādās :) Quote Link to comment Share on other sites More sharing options...
sega99 Posted May 6, 2013 Author Report Share Posted May 6, 2013 (edited) jā un abus sakārtot vienlīdz pēc datuma. hmm interesanti ar šo kvēriju man rāda to pašu ko pirmais. kreisajā pusē bmw bet labajā audi Edited May 6, 2013 by sega99 Quote Link to comment Share on other sites More sharing options...
draugz Posted May 7, 2013 Report Share Posted May 7, 2013 (edited) ( ( SELECT 'audi' as `type`, audi.title as title, audi.dateadded as added FROM audi ORDER BY audi.dateadded DESC LIMIT 10 ) UNION ( SELECT 'bmw' as `type`, bmw.title as title, bmw.date as added FROM bmw ORDER BY bmw.date DESC LIMIT 10 ) ); Šitā vajadzētu strādāt pareizi, vienīgi, ir nevis labā un kreisā puse, bet pielikta kolona tips. Un vispār mašīnas vajadzētu glabāt vienā tabulā, un vienkārši pielikt papildus lauku ražotājs. Edited May 7, 2013 by draugz Quote Link to comment Share on other sites More sharing options...
sega99 Posted May 7, 2013 Author Report Share Posted May 7, 2013 ( ( SELECT 'audi' as `type`, audi.title as title, audi.dateadded as added FROM audi ORDER BY audi.dateadded DESC LIMIT 10 ) UNION ( SELECT 'bmw' as `type`, bmw.title as title, bmw.date as added FROM bmw ORDER BY bmw.date DESC LIMIT 10 ) ); Šitā vajadzētu strādāt pareizi, vienīgi, ir nevis labā un kreisā puse, bet pielikta kolona tips. Un vispār mašīnas vajadzētu glabāt vienā tabulā, un vienkārši pielikt papildus lauku ražotājs. klausos ser un sanaca ! :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.