mysql ×Ó²éѯɾ³ý¼Ç¼
mysql ¿ÉÒÔͨ¹ý×Ó²éѯµÃµ½ÒªÉ¾³ýµÄ¼Ç¼Ìõ¼þ£¬È»ºóͨ¹ý×Ó²éѯµÃ½á¹ûÆ¥ÅäҪɾ³ýµÄ¼Ç¼¡£µ«ÊÇ mysql ²»ÄÜÖ±½Óɾ³ý×Ó²éѯ±íÖеÄÊý¾Ý£¬±ØÐëͨ¹ýÒ»¸öÁÙʱ±íÀ´½â¾ö¡£ÀýÈ磺
delete from t_transaction where exists
(select d.* from t_ti_category a,t_category b,t_trade_item c,t_transaction d
where b.FID=a.FCategory and a.FTradeItem=c.FID and c.FTrans=d.FID and b.FID=2549 and t_transaction.FID=d.FID)
Ôڸà sql Óï¾äÖÐÓÉÓÚ×Ó²éѯÖаüº¬ t_transaction ±í£¬µ«ÎÒÃÇͬʱҪɾ³ý t_transaction ±íÖеļǼ£¬ËùÒÔÔÊÐí¸ÃÓï¾äʱ±¨ÈçÏ´íÎó£º
1093-You can't specify target table 't_transaction' for update in from clause.
Ð޸ĺóµÄ²Ù×÷Óï¾äÈçÏ£º
delete from t_transaction where exists
(select e.FID from
(select d.* from t_ti_category a,t_category b,t_trade_item c,t_transaction d
where b.FID=a.FCategory and a.FTradeItem=c.FID and c.FTrans=d.FID and b.FID=2549) e
where t_transaction.FID=e.FID)
Ïà¹ØÎĵµ£º
connect·½·¨ÊÇjava.sql.Driver½Ó¿ÚÖж¨ÒåµÄ·½·¨£¬Èç¹ûÁ¬½ÓµÄÊý¾Ý¿â²»Í¬£¬ÄÇôΪ²»Í¬µÄÊý¾Ý¿â±àдJDBCÇý¶¯½«±äµÃºÜÁé»î£¬ÊµÏÖDriver½Ó¿Ú¼´¿É¡£Á¬½ÓÊý¾Ý¿âʱÊ×ÏȵÃ×°ÔØJDBCÇý¶¯£¬Ò²¾ÍÊǵ÷Óà Class.forName(“com.mysql.jdbc.Driver”)·½·¨£¬ÔÚµÚһƪÖÐÒѾÁгömysql jdbc DriverÀàµÄÔ´Â룬´ËÀà¼Ì³ÐNonRegisteringD ......
×ªÔØÇë×¢Ã÷×÷Õߺͳö´¦
http://www.cnlinux.net
Ò»¡¢½éÉÜ
========
²âÊÔ»·¾³£º
Server1:ndbd 192.168.0.11
Server2:ndbd 192.168.0.12
Server3:mysqld --ndb-cluster 192.168.0.13 (ndbd_mgm ndbd_mgmdÒ²ÔÚ±¾»ú)
²Ù×÷ϵͳ¾ùΪ
RH ES3
kernel-2.4.21-9.EL
glibc-2.3.2-95.6
ËùÐèÈí¼þ°ü£º
mysql-max-5.0.22-lin ......
# MySQL Server Instance Configuration File
# ----------------------------------------------------------------------
# Generated by the MySQL Server Instance Configuration Wizard
#
#
# Installation Instructions
# ----------------------------------------------------------------------
#
# On Li ......
Ò» ÏÂÔØMySQL
http://dev.mysql.com/downloads/mysql/5.0.html
½âѹMySQL£¨F:\Program Files\MySQL\£©MySQL°²×°Ä¿Â¼
¶þ н¨my.ini
ÔÚF:\Program Files\MySQL\Ͻ¨Á¢my.iniÎļþ£¬ÄÚÈÝΪ
my.ini
[mysqld]
# ÉèÖÃmysqlµÄ°²×°Ä¿Â¼
basedir=F:\\Program Files\\MySQL
# ÉèÖÃmysqlÊý¾Ý¿âµÄÊý¾ÝµÄ´æ·ÅĿ¼£¬±ØÐ ......