I have a table with data that looks like this:
create table demo_patient_info (
attend timestamp,
patient_id int,
blood_pressure double
);
I would like to write (preferably ANSI) SQL queries that allow me to do the following:
query1:
return the difference between bp of all patients with each other (using a WHERE clause to restrict the number of rows returned in the cartesian product)
query2:
return the difference between bp of each patient and one specific (i.e. specified) patient in the table