-- if a user sold less than two items, he/she will have no data from tb1, and thus will be assigned 'no' ...
SELECT e1.id, e1.company, e1.salary, COUNT(*) AS r, (SELECT COUNT(*) FROM employee WHERE company = e1.company) AS num -- when num % 2 = 0, the r of the median is num/2 and num/2 + 1 -- when num % 2 = ...
Note: This example uses a Version 6 view descriptor with the Pass-Through Facility to access DBMS data. Beginning in Version 7, you can associate a libref directly with your DBMS data and use the ...