select from table where column a is not equal column b (on same table) and tableID = 2

谁能给我一个简单的代码。

<?php
$query_myslot = "select from table where column a is not equal column b (on same table) and tableID = 2";
$myslot = mysql_query($query_myslot, $localhost) or die(mysql_error());
$row_myslot = mysql_fetch_assoc($myslot);
$totalRows_myslot = mysql_num_rows($myslot);
?>

最佳答案

尝试如下更改查询:

select * from tablename where column1 <> column2  and tableID = 2

关于php - 从表中选择,其中列a不等于列b(在同一表上)并且tableID = 2,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35240281/

10-14 13:53