Jump to content

problem with mysql union


funbinod

Recommended Posts

i'm trying to union some tables but it is showing some errors

here is what i wrote

	SELECT sum(amt) AS pamt FROM purchaseUNION	SELECT sum(amt) AS samt FROM salesUNION	SELECT sum(amt) AS ramt FROM receiptUNION	SELECT sum(amt) AS ptamt FROM payment AS pt

but it is selecting onle from first table (i.e. purchase) and for others it is saying "undefined index"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...