The used SELECT statements have a different number of columns

Viewed 82872

For examples I don't know how many rows in each table are and I try to do like this:

SELECT * FROM members 
UNION 
SELECT * FROM inventory

What can I put to the second SELECT instead of * to remove this error without adding NULL's?

6 Answers

Try this

(SELECT * FROM members) ;
(SELECT * FROM inventory);

Just add semicolons after both the select statements and don't use union or anything else. This solved my error.

Related