join on tables not working as expected MySQL

I am trying to join 2 tables and get the one with the grater date

Select ToolType,SerialNumber,Qty From Temp_MyTools Where FUploadTime > HUploadTime and SerialNumber NOT IN(
select ti.SerialNumber 
From Temp_IDs AS  ti 
LEFT Join Temp_MyTools as tm on tm.serialnumber = ti.serialnumber 
WHERE tm.FUploadTime > ti.UploadDate) 

Open in new window


tm.FUploadDate for 3 records is not  > ti.UploadDate Why is it pulling those serialnumbers in the subselect
LVL 6
r3nderAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
r3nderConnect With a Mentor Author Commented:
Now that I  wrote it out wouldn't it just be this to get those serial numbers
Select ToolType,SerialNumber,Qty From Temp_MyTools Where FUploadTime > HUploadTime and SerialNumber NOT IN(
select ti.SerialNumber 
From Temp_IDs AS  ti 
LEFT Join Temp_MyTools as tm on tm.serialnumber = ti.serialnumber 
WHERE ti.UploadDate > tm.FUploadTime) 

Open in new window

0
 
Haris DjulicCommented:
Hello,

can you post sample data for those 3 records?
0
 
r3nderAuthor Commented:
Here are the records in the subselect
Temp-IDs.csv
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
r3nderAuthor Commented:
here are the records I am comparing them to
Temp-MyTools.csv
0
 
SharathData EngineerCommented:
Can you post the expected result also?
0
 
r3nderAuthor Commented:
the expected results should be what is in Temp_MyTools.csv minus what is in  Temp_Ids.csv because the uploaddate in the Temp_MyIDs is greater than the FuploadTime in the Temp_MyTools table
0
 
r3nderAuthor Commented:
figured it out myself
0
All Courses

From novice to tech pro — start learning today.