-3

我怎样才能结合这个:

$raw_results = mysql_query("SELECT `item`, (`totalrate` / `nrrates`) AS `rank` FROM `rtgitems` ORDER BY (`totalrate` / `nrrates`) DESC LIMIT 5") or die(mysql_error());

有了这个?

INNER JOIN vouchers ON vouchers.item = rtgitems.item

谢谢

4

1 回答 1

0

只需将其连接到一个查询中:

$raw_results = mysql_query("SELECT rtgitems.item, (totalrate / nrrates) AS rank
                            FROM rtgitems 
                            INNER JOIN vouchers ON vouchers.item = rtgitems.item 
                            ORDER BY (totalrate / nrrates) 
                            DESC LIMIT 5") 
               or die(mysql_error());
于 2013-10-20T09:37:09.673 回答