I need to query the values in one table repeatedly against records in a temporary table, while the system_user is the same value ....
The temporary table @TmpTbl has three columns and data as per the example
usr startvalue endvalue
DOMAIN\user1 D10000 D10500
DOMAIN\user1 D10600 D10650
DOMAIN\user1 D10800 D10859
DOMAIN\user1 D10950 D10960
How can I find values in table DIM_DEPT where the values are between startvalue and endvalue for each row of the
@TmpTbl where the usr = DOMAIN\user1
Simple "between" wouldnt work because the query returns more than one value each time?