Re: What's wrong with this? (Left Join)
Hi,
If you are trying to 'flatten' out a table, maybe try a different query using crosstab techniques, typically Count(CASE) with a GROUP BY statement. I like IF() better than CASE but its non-standard and instead of counting occurences, use a max() to just report the value and not change or count it. I'm assumming there is only one value for each name and upload combination (if not, there are some other solutions).
select upload,
max( if (name='Address', value, NULL)) as Adress,
max( if (name='City', value, NULL)) as City,
max( if (name='State', value, NULL)) as State,
....
FROM ezu_uploadinfos
GROUP by 1;
I'm not sure what you mean by checking WHERE the email address equals the email address in this table? if its where two identical uploads have the same value for both 'Address' name and 'Email Address' name, then you should only need one self-join to find these cases...
Chris