Hi I am creating psql reports and at the minute I have two separate reports which do the same thing other than 1 has an extra column.
The scripts install a view in to the database which is used by some php front end to show the report nicely.
I would like to combine the two and wondered if it is possible to do the following inside the view, so it gets executed every time the report is clicked:
IF(access.accessname = 'UNBLINDED')
SELECT s.site, s.type, s.name etc
ELSE IF(access.accessname = 'BLINDED')
SELECT s.site, s.name etc
Or if not can anyone else think of a better way to do what I am currently doing with two different scripts?
Thanks for your help