<div class="code" style="position:relative; padding:0px; margin:0px;"><pre>SELECT cp.cname, cp.cprice, dc.dcsum, cp.cprice*dc.dcsum as fensu,sj.sjname FROMcp,dc,sj WHERE cp.cno=dc.dcno AND cp.sjno = sj.sjnohittlle原来这么简单。。。我想复杂了。。注意:三个表a,b,c 查询的时候要注意他们之间要有牵制,比如 a.s=b.s and a.s=c.s 这样,否则会有重复的东西出来,就算加了distinct 只会减少重复,而不能避免重复。</pre><div class="contentsignin">로그인 후 복사</div></div>