News

Default [1]

Default: 清理未有發票記錄的 e-mail

Contributed by TyroneYeh on Oct 06, 2009 - 11:12 PM

在發票登錄系統中有大半的 e-mail 是沒有記錄的,為了讓使用者數可以跟趨近事實所以清理了未有發票的使用者。

其實不影響,因為沒有發票記錄是沒有作用的,可能有些使用者以為會通知發票中獎號碼單吧!

這就錯了,因為通知只有通知預先輸入發票號碼等開獎後有中獎的發票才會通知!

也順便在有刪除作動時,順便刪除沒有發票的 e-mail 記錄!

不過在此出現問題!就是 SQL 語法上的問題, 下了這樣的語法:


delete from zk_uninvc_user where pn_uid in (select a.pn_uid from zk_uninvc_user a left join zk_uninvc_rec b on a.pn_uid = b.pn_userid group by a.pn_uid having count(b.pn_uid) = 0);

錯誤如下:

ERROR 1093 (HY000): You can't specify target table 'zk_uninvc_user' for update in FROM clause

 後來查了一下資料把語法改一下就可以了,如下:


delete from zk_uninvc_user where pn_uid in (select pn_uid from (select a.pn_uid from zk_uninvc_user a left join zk_uninvc_rec b on a.pn_uid = b.pn_userid group by a.pn_uid having count(b.pn_uid) = 0) a );

 

Rating

No one has rated this item yet - be the first!

1 is the lowest and 5 the higher score.

 
Links
  1. http://siryeh.com/index.php?module=News&func=view&prop=Main&cat=32
  2. http://siryeh.com/javascript:ratingsratefromslider('News','38',20);
  3. http://siryeh.com/javascript:ratingsratefromslider('News','38',40);
  4. http://siryeh.com/javascript:ratingsratefromslider('News','38',60);
  5. http://siryeh.com/javascript:ratingsratefromslider('News','38',80);
  6. http://siryeh.com/javascript:ratingsratefromslider('News','38',100);