mysql replication with one database
Hi All! I have two mysql server A,B. I'm using the replication between these servers. But i want to the replication work with just one database. Example: A server: database1, database2, database3 B server: database1, database4, database5 The A.database1 and B.database1 is same! I want replicate only this database1! Thanks is advance. Zoltan, Gyurasits DIGITAL SYSTEM - www.digsys.hu
Re: SQL SELECT HELP
Hi, Ok. This is good!! Thank you! Zoli Egor Egorov [EMAIL PROTECTED] 2004-04-30 03:30 PM To: [EMAIL PROTECTED] cc: (bcc: Zoltan Gyurasits/GYO/COMP/PHILIPS) Subject:Re: SQL SELECT HELP Classification: [EMAIL PROTECTED] wrote: Sorry. My english is not so good. :( I try to explain. I have table1 : ID value -- 1 100 1 101 1 102 1 200 2 100 2 300--- 2 310 | 3 100 | | and table2: | | value | --- | 300 - The result of the query should be from IDs of table1 (In this case 1,3) . The ID 2 is not allowed, because the table2 is the exception table wich is containing the value 300. You need something like: SELECT DISTINCT t3.id FROM table2 t2 INNER JOIN table1 t1 ON t1.value=t2.value RIGHT JOIN table1 t3 ON t1.id=t3.id WHERE t1.id IS NULL; -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: SQL SELECT HELP
Hi, Sorry. My english is not so good. :( I try to explain. I have table1 : ID value -- 1 100 1 101 1 102 1 200 2 100 2 300--- 2 310 | 3 100 | | and table2: | | value | --- | 300 - The result of the query should be from IDs of table1 (In this case 1,3) . The ID 2 is not allowed, because the table2 is the exception table wich is containing the value 300. Michael Stassen [EMAIL PROTECTED] 2004-04-28 06:13 PM To: Zoltan Gyurasits/GYO/COMP/[EMAIL PROTECTED] cc: [EMAIL PROTECTED] Subject:Re: SQL SELECT HELP Classification: I'm afraid I don't understand. From your first message, it appears you want a list of rows from table1 whose ids do not appear in table2. The query Egor sent you does just that. Did you try it? If, as you say here, that isn't what you want, could you please describe what you do want? Michael [EMAIL PROTECTED] wrote: Thanks your help, but I would like to do the following: If I have is ONE same ID between the two tables, than the result it must be empty. Egor Egorov [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: snip I have a query problem. I want to make a query SELECT* FROM table1 INNER JOIN table2 ON table1.id NOT IN table2.id But I can't use the NOT IN expression here. What can i do? I have the MySQL version 4.x I can't use subquery :( If I've got you right you need LEFT JOIN instead of INNER JOIN. SELECT * FROM table1 LEFT JOIN table2 ON table1.id=table2.id WHERE table2.id IS NULL; -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: SQL SELECT HELP
Hi, Thanx the answer! I have tried it, but didn't work correctly. The result was 1,2,3 :(( Nitin [EMAIL PROTECTED] 2004-04-29 09:54 AM To: Zoltan Gyurasits/GYO/COMP/[EMAIL PROTECTED] Michael Stassen [EMAIL PROTECTED] cc: [EMAIL PROTECTED] Subject:Re: SQL SELECT HELP Classification: I hope it should work: Select table1.ID from table1 left join table2 on table1.value=table2.value where table2.value is null OR if you want distinct IDs Select distinct table1.ID from table1 left join table2 on table1.value=table2.value where table2.value is null though I didn't test it, if it does (or doesn't) let me know Regards Nitin - Original Message - From: [EMAIL PROTECTED] To: Michael Stassen [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, April 29, 2004 1:15 PM Subject: Re: SQL SELECT HELP Hi, Sorry. My english is not so good. :( I try to explain. I have table1 : ID value -- 1 100 1 101 1 102 1 200 2 100 2 300--- 2 310 | 3 100 | | and table2: | | value | --- | 300 - The result of the query should be from IDs of table1 (In this case 1,3) . The ID 2 is not allowed, because the table2 is the exception table wich is containing the value 300. Michael Stassen [EMAIL PROTECTED] 2004-04-28 06:13 PM To: Zoltan Gyurasits/GYO/COMP/[EMAIL PROTECTED] cc: [EMAIL PROTECTED] Subject:Re: SQL SELECT HELP Classification: I'm afraid I don't understand. From your first message, it appears you want a list of rows from table1 whose ids do not appear in table2. The query Egor sent you does just that. Did you try it? If, as you say here, that isn't what you want, could you please describe what you do want? Michael [EMAIL PROTECTED] wrote: Thanks your help, but I would like to do the following: If I have is ONE same ID between the two tables, than the result it must be empty. Egor Egorov [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: snip I have a query problem. I want to make a query SELECT* FROM table1 INNER JOIN table2 ON table1.id NOT IN table2.id But I can't use the NOT IN expression here. What can i do? I have the MySQL version 4.x I can't use subquery :( If I've got you right you need LEFT JOIN instead of INNER JOIN. SELECT * FROM table1 LEFT JOIN table2 ON table1.id=table2.id WHERE table2.id IS NULL; -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
SQL SELECT HELP
Hi, I have a query problem. I want to make a query SELECT* FROM table1 INNER JOIN table2 ON table1.id NOT IN table2.id But I can't use the NOT IN expression here. What can i do? I have the MySQL version 4.x I can't use subquery :( Thank you in advanced, Zoli
Re: SQL SELECT HELP
Thanks your help, but I would like to do the following: If I have is ONE same ID between the two tables, than the result it must be empty. Egor Egorov [EMAIL PROTECTED] 2004-04-28 12:10 PM To: [EMAIL PROTECTED] cc: (bcc: Zoltan Gyurasits/GYO/COMP/PHILIPS) Subject:Re: SQL SELECT HELP Classification: [EMAIL PROTECTED] wrote: I have a query problem. I want to make a query SELECT* FROM table1 INNER JOIN table2 ON table1.id NOT IN table2.id But I can't use the NOT IN expression here. What can i do? I have the MySQL version 4.x I can't use subquery :( If I've got you right you need LEFT JOIN instead of INNER JOIN. SELECT * FROM table1 LEFT JOIN table2 ON table1.id=table2.id WHERE table2.id IS NULL; -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]