phpbar.de logo

Mailinglisten-Archive

alles was nit in Tabelle x in tabelle z schreiben

alles was nit in Tabelle x in tabelle z schreiben

Uwe Driessen driessen at fblan.de
Mon Feb 9 13:09:54 CET 2009


Hallo Liste ich hab mal wieder eine Blockade

Ich möchte aus Tabelle 1 alles einträge in Tabelle 2 haben 
welche aber nicht in Tabelle 3 sind 
und in Tabelle5 entweder Wert1 = var1 oder wert1= var2 haben.

insert into ispcp.domain_aliasses (`domain_id`, `alias_name`, `alias_status`,
						`alias_mount`, `alias_ip_id`,
`url_forward`)
        select t2.do_id_neu, t2.domain_name, "toadd", t2.domain_name, 1, "no"
        from openprovide.op_domains t2
             join ispcp.domain t3 on t2.domain_name = t3.domain_name
        where t2.domain_name 
		not EXISTS (select 1 from ispcp.domain t4 where t2.domain_name =
t4.domain_name  )
            and  (select 1 from openprovide.diehl_domain t5
                    where t5.name = t2.domain_name and
                   (t5.domainip = "IP" 
				or t5.domainip = "mail");

oder 

insert into ispcp.domain_aliasses (`domain_id`, `alias_name`, `alias_status`,
`alias_mount`, `alias_ip_id`, `url_forward`)
        select t2.do_id_neu, t2.domain_name, "toadd", t2.domain_name, 1, "no"
        from openprovide.op_domains t2
                join ispcp.domain t3 on t2.domain_name = t3.domain_name
                join openprovide.diehl_domain t5 on t2.domain_name = t5.name
        where t2.domain_name NOT EXISTS  (select 1 from ispcp.domain t4 where
t2.domain_name = t4.domain_name  )
                        and   (t5.domainip = "IP" or t5.domainip = "mail");


mögen mich nicht 

ich bekomme immer den Fehler

1064 - Fehler in der SQL-Syntax. Bitte die korrekte Syntax im Handbuch nachschlagen bei
'EXISTS  (select 1 from ispcp.domain t4 where t2.domain_name = t4.domain_name  )
' in Zeile 6 


Mit freundlichen Grüßen

Drießen

-- 
Software & Computer
Uwe Drießen
Lembergstraße 33
67824 Feilbingert
Tel.: +49 06708 / 660045   Fax: +49 06708 / 661397

_______________________________________________
Allgemeine Infos zur Liste: http://www.4t2.com/mysql/
Verwaltung: https://lists.4t2.com/cgi-bin/mailman/listinfo/mysql-de

php::bar PHP Wiki   -   Listenarchive