时间:2021-07-01 10:21:17 帮助过:32人阅读
select (T2.id - T1.id)from table1 T1,table2 T2 where T1.num1=T2.num1 AND T1.num2=T2.num2 AND T1.num3=T2.num3
SELECT a.id, a.id - b.id AS sub FROM mydb1 a, mydb1 b WHERE a.号码1 = b.号码1 AND a.号码2 = b.号码2 AND a.号码3 = b.号码3 HAVING sub >0
麻烦再详细点呗
这样写对吗?怎么输出哇?
$result = mysql_query("SELECT a.id, a.id - b.id FROM mydb1 a, mydb1 b WHERE a.hao1 = b.hao1 && a.hao2 = b.hao2 && a.hao3 = b.hao3 HAVING sub >0");
while($row = mysql_fetch_array($R1))
{
echo $row['']