![](/img/trans.png)
[英]PHP/MySQL - Select all the rows where column from table 1 is equal to column from table 2
[英]select from table where column a is not equal column b (on same table) and tableID = 2
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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.