Karyna,
Notice I reformatted the SQL code for you as well as adding the [ CODE ] tags. I wonder how so many members seem to expect us to be able to read their SQL when they just dump it in a mess without any sort of formatting. This takes no special expertise, simply a little time and effort. I don't mean to bust your chops on this, but I really just don't get how this happens so often. As this is your first post I won't make a big deal out of it (in truth I want to leave it for others to find as they search through, rather than direct it specifically at yourself).
If you re-examine it now, you will see a number of mistakes (especially if I point them out to you) :
- As mentioned before, the first character is missing from the SELECT on line #1.
- On line #9 there is the remnants of an INNER JOIN statement. I guess someone decided to use the UNION ALL instead but failed to clear away the INNER JOIN fully.
- The second SELECT query in the UNION (starting at line #11) refers to the wrong table. All the lines from #11 to #18 should be referring to TRANSFORMERSNew rather than TRANSFORMERS.
Welcome to
Bytes!