Jump to content
php.lv forumi

kaa iztikt bez UNION ?


andrisp

Recommended Posts

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

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

×
×
  • Create New...