where 字段选择


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

?select * from bdorder a join frmuser b on a.salesstaff = b.account and a.salesstaff like ‘asong%’
?select * from bdorder a join frmuser b on a.salesstaff = b.account and? b.account like ‘asong%’
bdorder 与 frmuser有相同的用户,在where条件中选择b.account进行筛选比用bdorder的salesstaff要好的多,因为不可避免的是bdorder有重复的salesstaff,而frmuser则不会有重复,就少了一些比较。
即:在使用join时,where条件选择数据较少的表的字段进行筛选。