我目前发现自己处于困惑之中,因为这个查询在MySQL中工作得很好,但不如PHP好。 返回消息指出“操作数应包含1列”。先谢谢你了
表1
| TRADE_DATE |开放| HIGH |低|关闭| VOLUME |
+ ------------ + ----------- + ----------- + --------- - + ----------- + --------- +
| 2015-07-16 | 60.779999 | 60.869999 | 60.75 | 60.830002 | 1050400 |
| 2015-07-15 | 60.34 | 60.560001 | 60.220001 | 60.389999 | 1096400 |
| 2015-07-14 | 60.18 | 60.610001 | 60.169998 | 60.549999 | 1328900 |
| 2015-07-13 | 60.00 | 60.23 | 60.00 | 60.18 | 973300 |
| 2015-07-10 | 59.57 | 59.82 | 59.380001 | 59.720001 | 1506700 |
表2 + ------------ + ----------- ----------- + + ----------- + ----------- + --------- +
| TRADE_DATE |开放| HIGH |低|关闭| VOLUME |
+ ------------ + ----------- + ----------- + --------- - + ----------- + --------- +
| 2015-07-17 | 60.950001 | 60.950001 | 60.66 | 60.790001 | 731000 |
| 2015-07-16 | 60.779999 | 60.869999 | 60.75 | 60.830002 | 1050400 |
| 2015-07-15 | 60.34 | 60.560001 | 60.220001 | 60.389999 | 1096400 |
| 2015-07-14 | 60.18 | 60.610001 | 60.169998 | 60.549999 | 1328900 |
| 2015-07-13 | 60.00 | 60.23 | 60.00 | 60.18 | 973300
这是查询
<div class="col-md-6">
<table class="table">
{% for offer in latest_offers %}
<tr><th>{{offer.category}}</th></tr>
<tr><td><img src="{{ offer.images.url }}" height="120" width="200" alt="error"></td></tr>
<tr><td>{{offer.city}} {{offer.district}} {{offer.floor_space}} {{offer.price}} </td></tr>
{% endfor %}
</table><br />
</div>
答案 0 :(得分:0)
(A)你无法做not in (select [multiple columns])
(B)您not in
需要查看table1
,而不是table2,因为您正在尝试合并table2中包含尚未包含在table1中的日期的数据。