I am trying to select two columns from two different tables, where a value exists in both tables and the time in one table is >= now - 30 minutes. How ever it is returning all the firstnames and then inserting the same time for all names?
Here is the schema for the two tables;
CREATE TABLE probes ( mac_address TEXT, vendor TEXT, ssid TEXT, date_Stamp NUMERIC, time_Stamp NUMERIC, rssi INTEGER, bssid TEXT ) CREATE TABLE `studentDetails` ( studentID INTEGER UNIQUE, firstName TEXT, lastName TEXT, macAddress TEXT, pictureLocation TEXT, PRIMARY KEY(studentID) )
Finally here is my query:
SELECT time_Stamp, firstName FROM probes INNER JOIN studentDetails WHERE EXISTS ( select mac_address from probes where mac_address = studentDetails.macAddress) AND time_Stamp >= time('now') GROUP BY firstName
"14:52:16" "Hanna "
"14:52:16" "Liam "
Even though only one of those users has that time?
Any help would be much appreciated.