Welcome Guest, Not a member yet? Register   Sign In
Returning the query result of three UNION tables to VIEW
#8

[eluser]@rno[/eluser]
Hi,

I think you should slightly change your SQL, make ik look like:

Code:
SELECT productid AS 'id', name, description, 1 AS 'tble_type' FROM product
UNION
SELECT serviceid AS 'id', name, description, 2 AS 'tble_type' FROM services
UNION
SELECT imageid AS 'id', name, description, 3 AS 'tble_type' FROM image

This way you get 4 columns, all having the same name, so displaying them all at once, or separated bij 'tbl_type' wouldn't be any problem.

Regards,
Arno


Messages In This Thread
Returning the query result of three UNION tables to VIEW - by El Forum - 11-02-2009, 05:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB