使用INNER JOIN重新创建查询?

时间:2013-07-15 14:21:31

标签: mysql sql select inner-join

如何使用Inner-Join转换此查询:

db_query("select max(field_date_and_time_value2) as last_time 
    from field_data_field_date_and_time 
    where (field_date_and_time_value2 > '".$today."') 
    AND (".$node->uid." = (select uid from node where nid = " . $node->nid ."))");

1 个答案:

答案 0 :(得分:0)

from field_data_field_date_and_time fdt
JOIN node on fdt.<field> = node.uid

如果没有看到您的架构,很难说FK在这里是什么。