包含货币,汇率,临时时间的表格 - 我想在同一时间段内为美元汇率划分一些选定的汇率。
var hash = window.location.hash;
$(function() {
$('#nav-tab a').click(function(){
window.location.hash = $(this).attr('aria-controls');
});
$('[href="'+hash+'"]').trigger('click');
});
由于
答案 0 :(得分:1)
您可以使用交叉加入USD查询
$result2 = mysql_query("SELECT a.currency, a.date, a.rate/b.rate
FROM `currency_rates` a
CROSS JOIN `currency_rates` b
WHERE b.currency = 'USD'
AND a.currency IN ('AUD', 'CAD', 'EUR')
ORDER BY a.temptime asc");
如果您需要每个临时时间的结果(如RaymondNijland所建议的那样)
$result2 = mysql_query("SELECT a.currency, a.date, a.rate/b.rate
FROM `currency_rates` a
INNER JOIN `currency_rates` b ON a.temptime = b.temptime
AND b.currency = 'USD'
AND a.currency IN ('AUD', 'CAD', 'EUR')
ORDER BY a.temptime asc");