Mysql
 sql >> Datenbank >  >> RDS >> Mysql

So formulieren Sie eine SQL-Abfrage neu

Würde so etwas funktionieren?

SELECT
    max(a.field_date_and_time_value2) as last_time
    , b.uid
FROM field_data_field_date_and_time a
    INNER JOIN
        node b
    ON
        /* this piece might be wrong. what is the relationship between the first table and the second one? */
        b.nid = '".$node->nid."'
where
    a.field_date_and_time_value2 > '".$today."' AND
    b.uid = $node->nid