freak Posted January 21, 2009 Report Share Posted January 21, 2009 Nesaprotu kapēc nestrādā phpmyadminā un arī pašā lapā tāda lieta kā UNION? Tāda opcija ir pieejama? Link to comment Share on other sites More sharing options...
NiTrino Posted January 21, 2009 Report Share Posted January 21, 2009 kāpēc nestrādā? SELECT x1 FROM y1 WHERE z1=1 UNION SELECT x2 FROM y2 WHERE z2=2 ... Link to comment Share on other sites More sharing options...
Delfins Posted January 21, 2009 Report Share Posted January 21, 2009 Nesaprotu kapēc.. 99.8%, ka risinājums/atbilde ir kļūdas paziņojumā. Link to comment Share on other sites More sharing options...
freak Posted January 21, 2009 Author Report Share Posted January 21, 2009 Nu piemeram. Divas tabulas. CREATE TABLE t1 ( n int(3) NOT NULL default '0' ) TYPE=MyISAM; INSERT INTO t1 VALUES (10); INSERT INTO t1 VALUES (10); INSERT INTO t1 VALUES (10); CREATE TABLE t2 ( n int(3) NOT NULL default '0' ) TYPE=MyISAM; INSERT INTO t2 VALUES (10); INSERT INTO t2 VALUES (10); INSERT INTO t2 VALUES (30); Vaicajums: SELECT n FROM t1 UNION ALL SELECT n FROM t2 Nestrada. Rada eroru. Link to comment Share on other sites More sharing options...
NiTrino Posted January 21, 2009 Report Share Posted January 21, 2009 A erroru ir liels noslēpums ierakstīt? Link to comment Share on other sites More sharing options...
freak Posted January 21, 2009 Author Report Share Posted January 21, 2009 A erroru ir liels noslēpums ierakstīt? MySQL said: Something is wrong in your syntax près de 'UNION ALL SELECT n FROM t2 LIMIT 0, 30' à la ligne 1 :) Link to comment Share on other sites More sharing options...
NiTrino Posted January 21, 2009 Report Share Posted January 21, 2009 Showing rows 0 - 5 (6 total, Query took 0.0031 sec) SQL query: SELECT n FROM t1 UNION ALL SELECT n FROM t2 LIMIT 0 , 30 n 10 10 10 10 10 30 Link to comment Share on other sites More sharing options...
Gints Plivna Posted January 21, 2009 Report Share Posted January 21, 2009 Ja vien nav kaut kāda hiperaizvēsturiska MySQL versija, tad jāstrādā, kā jau tika demonstrēts. http://dev.mysql.com/doc/refman/4.1/en/union.html UNION is available from MySQL 4.0.0 on. Gints Plivna http://datubazes.wordpress.com Link to comment Share on other sites More sharing options...
Maris-S Posted January 21, 2009 Report Share Posted January 21, 2009 Es te skatos ka ir atšķirības starp piemēru ko sākumā iemeti ar visām tabulu veidošanām un ar piemēru, kas ir parādot kļūdas paziņojumu. Konkrēti pie kļūdas paziņojuma ir LIMIT 0, 30, bet pirmajam piemēram tā nav. Tas pirmais piemērs izskatās pareizs, bet tā kā otrais ir atšķirīgs no pirmā par tā pareizību nevar spriest neredzot sql vaicājumu pilnībā. Link to comment Share on other sites More sharing options...
Grey_Wolf Posted January 21, 2009 Report Share Posted January 21, 2009 Maris-S --> ja nesi pamanijis tad PhpMyAdmin kabina klaat to LIMIT ... Link to comment Share on other sites More sharing options...
freak Posted January 22, 2009 Author Report Share Posted January 22, 2009 Ja vien nav kaut kāda hiperaizvēsturiska MySQL versija, tad jāstrādā, kā jau tika demonstrēts.http://dev.mysql.com/doc/refman/4.1/en/union.html UNION is available from MySQL 4.0.0 on. Gints Plivna http://datubazes.wordpress.com A jaa laikam toch versijai vaina. Uz cita servera pamegjinaju viss ir ok. Link to comment Share on other sites More sharing options...
Recommended Posts