lorebringer
Member
My SQL is atrocious and this isn't tested and probably won't work and be just as bad but something like:
	
	
	
		
I think comma separating like you had originally is the same as doing CROSS JOIN, which results in a table that has n * n rows, whereas an INNER JOIN should result in a table that has only the entries that match on the join points. I could be completely 100% wrong.
				
			
		Code:
	
	SELECT A.TransDate 
FROM pricevolume as A 
INNER JOIN pricevolume as B 
    ON A.ClosePrice = B.OpenPrice * 2 
    AND DATEDIFF(B.transdate, A.transdate) = 1 
    AND A.ticker = 't' AND B.ticker = 't'I think comma separating like you had originally is the same as doing CROSS JOIN, which results in a table that has n * n rows, whereas an INNER JOIN should result in a table that has only the entries that match on the join points. I could be completely 100% wrong.
 
	 
				 
 
		 )
) Probably not great advice, but we're all lazy, right?
 Probably not great advice, but we're all lazy, right? 
	 
	 
	