Error: The used SELECT statements have a different number of columns
UNIONs (UNION and UNION ALL) require that all the queries being UNION’d have: The same number of columns in the SELECT clause The column data type has to match at each position Your query has: SELECT f.*, u1.*, u2.* … UNION SELECT fid2 FROM friends The easiest re-write I have is: SELECT f.*, u.* FROM … Read more