Member since
02-13-2020
2
Posts
0
Kudos Received
0
Solutions
02-18-2020
03:54 PM
Is table-b's value fixed? You mentioned 1 or 2. Are they pre-defined? If you know the values up-front, then you don't need to do cross join, just add conditions based on the fixed number of values, like below: SELECT * FROM table-a WHERE TABLE-a.date_col <= from_unixtime(unix_timestamp()-(1*24*60*60))) OR TABLE-a.date_col <= from_unixtime(unix_timestamp()-(2*24*60*60))) OR TABLE-a.date_col <= from_unixtime(unix_timestamp()-(3*24*60*60))) ... Not sure if it still meet your requirement. Cheers
... View more