andrisp Posted May 16, 2005 Report Share Posted May 16, 2005 tipa triis tabulas, struktuura visaam vienaada, kaa lai iztiek bez UNION, bet lai pieprasiijuma rezultaats buutu identisks rezultaatam, kas buutu izmantojot UNION ? paldies Link to comment Share on other sites More sharing options...
bubu Posted May 16, 2005 Report Share Posted May 16, 2005 CREATE TEMPORARY TABLE blabla (col1 INT, col2 CHAR(10), ...); INSERT INTO blabla SELECT colA, colB FROM table1 WHERE ...; INSERT INTO blabla SELECT colX, colY FROM table2 WHERE ...; SELECT * FROM blabla; <-- šitā rezultātus ņem lietošanai. DROP TABLE blabla; -- kautgan blabla tabula pati iznīcināsies, kad taisīsi mysql_close(); Link to comment Share on other sites More sharing options...
andrisp Posted May 16, 2005 Author Report Share Posted May 16, 2005 CREATE TEMPORARY TABLE blabla (col1 INT, col2 CHAR(10), ...); INSERT INTO blabla SELECT colA, colB FROM table1 WHERE ...; INSERT INTO blabla SELECT colX, colY FROM table2 WHERE ...; SELECT * FROM blabla; <-- šitā rezultātus ņem lietošanai. DROP TABLE blabla; -- kautgan blabla tabula pati iznīcināsies, kad taisīsi mysql_close(); 17576[/snapback] es jau saaku shitaa taisiit.. vieniigi es izmantoju CREATE TEMPORARY TABLE blabla SELECT * FROM table; INSERT INTO blabla SELECT * FROM table2; kaa uzvediisies Unikaalas kolumnas (ID) ? Piemeram ja man abaas tabulaas zem ID buus fiildi ar vienaadiem ID ? Link to comment Share on other sites More sharing options...
bubu Posted May 16, 2005 Report Share Posted May 16, 2005 Nu ja tai temporārajai tabulai nedefinēsi to kolonnu id kā unikālu/primāro, tad būs ok. Link to comment Share on other sites More sharing options...
Recommended Posts