(Beginner) MYSQL: What can I do about this where statement?
SELECT tableA.*
FROM tableA
JOIN ( SELECT DISTINCT column1
       FROM tempTable ) temp ON tableA.column1 &lt;=&gt; temp.column1

&lt;=&gt; is null-safe compare operator. It assumes that NULL is equal to NULL whereas regular comparing operator = considers them unequal.
Subquery is used for to collapse equal values in tempTable - if not then each value from tableA may be selected a lot of times.