i thought doing a union between two queries will g...
# lucee
s
i thought doing a union between two queries will get me distinct records, even in both queries i have one column being returned and almost same data but to be sure, i tried to use union but it got me everything
Copy code
<cfquery name="getCompiled" dbtype="query">
        select distinct num1 from getAssignments 
        union 
        select distinct num1 from getCompleted
    </cfquery>
m
Verified that Adobe CF does filter out duplicates in a query of queries union https://trycf.com/gist/9b3e55db0db4a21c6536729ee494c898/acf2021?theme=monokai
And Lucee 6 successfully does as well
and lucee 5 does as well
b
Correct. Older versions of Lucee 5 did not however. What CF engine/version are you on?
a
Can you
UNION ALL
?
Wait, never mind, that's not what you want.