I've made a view from a (complex) select statement of 4 tables in my database.
lest say I get results like these...
colname1 colname2 colname3 colname4
---------------------------------------------------
patient1 med1 usage1 diagnum
patient1 med2 usage2 diagnum
patient1 med3 usage3 diagnum
I would like to cortrect my query so that the result is the following...
colname1 colname2 colname3 colname4
---------------------------------------------------
patient1 med1 usage1 diagnum
med2 usage2
med3 usage3
since the patient number is the same and the diag num is the same
i want ot be able to avoid the repetition...
this might not help but heres is my original query
CREATE OR REPLACE VIEW PRESCRIPTIONS AS
SELECT DISTINCT d.NoAssMaladie, p.prenompatient || ' ' || UPPER(p.nompatient) AS NomPatient, l.nomedicament AS NoMedic,m.libmedicament AS Libelle, l.quantite || ',' || l.prises || ',' || l.duree AS "Desc. d.usage", l.nodiagnostic AS Diag
FROM lignes_prescriptions l, patients p, diagnostics d, medicaments m
WHERE l.nodiagnostic = d.nodiagnostic AND
d.noassmaladie = p.noassmaladie AND
m.nomedicament = l.nomedicament AND
d.RESULTATDIAGNOSTIC = 'P' AND
d.NoAssMaladie = 'SANL 6005 1218'
where my patient is 'SANL 6005 1218'
And secondly I would like to know how to make a view that will ask for a value that I can apply to my where statement.
lets say I wanted to ask for the patient number 'SANL 6005 1218' instead of putting it into my query directly.