I have been presented with a really strange task on a 30 questions questionare for a course I'm attending after work.
I din't think you could do like this, or I might just be wrong here!
This is the question:
Createa view kalled PS from table persons.
They view should contain two columns:
PA (PERSON_ATTR) and SUM
The values in first column should be
Food, Address and E-Mail
In second column the number of persons that has somthing filled in into thoose columns should be listed.
p_id, address, food, email
Now I could get the values they want like this:
select count(1) from PS where food IS NOT NULL;
select count(1) from PS where address IS NOT NULL;
select count(1) from PS where email IS NOT NULL;
I could even put all of theese three into one row.
But how do I get theese values as follows in view:
I have done quite som development, but never tinkered with such complex vies as this seems to be.
Any pointer or example on how to do this would be helpful.
I have 30 questions, I only need to pass 24, so this question isn't that important, I just want to know if it at all is possible to do like this.
There wasn't any pre-requisites for this course so I'm abit surprised such a question has come after a week.
/Hans - Erik Skyttberg