tags:

views:

124

answers:

0

i've got this query:

SELECT * FROM (
(SELECT ACCOUNTS.INSTALLTIME, ACCOUNTS.HONAME, ACCOUNTS.ADDRESS, ACCOUNTS.CITY, ACCOUNTS.STATE, ACCOUNTS.ZIP, ACCOUNTS.JOBNUMBER, ACCOUNTS.INSTALLDATE, ACCOUNTS.RESULT, ACCOUNTS.NOTES, ACCOUNTS.SMNOTES, technicians.technumber, technicians.boardplacing 
FROM ACCOUNTS 
INNER JOIN technicians ON ACCOUNTS.INSTALLER = technicians.technumber) 
UNION 
(SELECT service.servicetime, service.Customername, service.address, service.city, service.state, service.zip, service.ID, service.serviceday, service.result, service.servicenotes, service.board, technicians.technumber, technicians.boardplacing
FROM service 
INNER JOIN technicians ON service.technician= technicians.technumber)
) as t WHERE t.INSTALLDATE = '$date' ORDER BY t.boardplacing

is there any way I can make a query similar to:

SELECT * FROM (
(SELECT ACCOUNTS.INSTALLTIME, ACCOUNTS.HONAME, ACCOUNTS.ADDRESS, ACCOUNTS.CITY, ACCOUNTS.STATE, ACCOUNTS.ZIP, ACCOUNTS.JOBNUMBER, ACCOUNTS.INSTALLDATE, ACCOUNTS.RESULT, ACCOUNTS.NOTES, ACCOUNTS.SMNOTES, '' as priority, ACCOUNTS.PAFS, ACCOUNTS.upsell, ACCOUNTS.TERM, ACCOUNTS.MMRUPGRADE, ACCOUNTS.WARRANTY, ACCOUNTS.EFT, technicians.technumber, technicians.boardplacing 
FROM ACCOUNTS 
INNER JOIN technicians ON ACCOUNTS.INSTALLER = technicians.technumber) 
UNION 
(SELECT service.servicetime, service.Customername, service.address, service.city, service.state, service.zip, service.ID, service.serviceday, service.result, service.servicenotes, service.board, '', '', '', '', '', '', technicians.technumber, technicians.boardplacing
FROM service 
INNER JOIN technicians ON service.technician= technicians.technumber)
) as t WHERE t.INSTALLDATE = '$date' ORDER BY t.boardplacing

basically i need fake columns in my union. is there any way to pull that off with the joins? is there some other better way to do this?