mercredi 30 décembre 2015

DBFlow - inner join with another select statement

I'm trying to convert the following SQL statement into DBFlow method calls:

SELECT t.SSID, t.BSSID, t.Latitude, t.Longitude, t.Timestamp 
FROM wlan_events t 
INNER JOIN (SELECT BSSID, MAX(Timestamp) AS MaxTimestamp FROM wlan_events GROUP BY BSSID) groupedt 
ON t.BSSID = groupedt.BSSID AND t.Timestamp = groupedt.MaxTimestamp

What I got so far:

SQLite.select(WifiEvent_Table.SSID, WifiEvent_Table.BSSID, WifiEvent_Table.latitude,
    WifiEvent_Table.longitude)
    .from(WifiEvent.class)
    .as("t")
    .innerJoin(WifiEvent.class) // ????

;

How do i create that inner join statement using dbflow?

Aucun commentaire:

Enregistrer un commentaire