On Wed, 4 Dec 2002 17:38:00 +0200, Victoria Reznichenko wrote: >Kittiphum, >Wednesday, December 04, 2002, 1:49:08 PM, you wrote: > >K> This query can find the record in Table1 that not found in Table2 > >K> SELECT Table1.ID FROM Table1 LEFT JOIN Table2 Using(ID) >K> WHERE Table2.ID IS NULL > >K> and what query that use to delete the record in Table1 that not >found >K> in Table2 such as > >K> Delete from Table1 where Table1.ID in >K> SELECT Table1.ID FROM Table1 LEFT JOIN Table2 Using(ID) >K> WHERE Table2.ID IS NULL > >K> because of MySQL ver 3.23.XX not support sub select while we >still >K> use 3.23.XX > >In 3.23. you can't do it with single SQL statement. You can use >programming language or use CONCAT() function as described here: >http://www.mysql.com/doc/en/ANSI_diff_Sub-selects.html > Yes I use this method before but I don't want to resend the first result from conncat() back to MySQL to perform the second query again can I place the result somewhere may be some memory or some file on MySQL server so MySQL can use it automatic for the secod query
>K> and one more question > >K> How to merge table with varchar type not char type (because if >table >K> contain varchar column we can't merge them but with table that >only >K> have char column it work) > >It works fine for me. If it doesn't work for you, please, provide >some more info. > I still not know what error because I do the same query that used to be error but it work today???? but if I specify insert method I got error like this Error: 1064 - You have an error in your SQL syntax near 'INSERT_METHOD=LAST' I try to change to INSERT_METHOS=FIRST i got the same error so I change to CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, message CHAR(20)); CREATE TABLE t2 (a INT AUTO_INCREMENT PRIMARY KEY, message CHAR(20)); INSERT INTO t1 (message) VALUES ("Testing"),("table"),("t1"); INSERT INTO t2 (message) VALUES ("Testing"),("table"),("t2"); CREATE TABLE total (a INT AUTO_INCREMENT PRIMARY KEY, message CHAR(20)) TYPE=MERGE UNION=(t1,t2); it work but when I insert data into merge table i got Error: 1031 - Table handler for 'total' doesn't have this option What happen and how to solve this. Thanks. Kittiphum Worachat,M.T --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php