Paste number 46504: sql joins

Paste number 46504: sql joins
Pasted by: avium
1 year, 4 months ago
None
Paste contents:
Raw Source | XML | Display As
mysql> SELECT COUNT(1) FROM metric_oscar_data1 JOIN external_facility USING (fpn) LEFT JOIN facility ON (external_facility.fpn = facility.fprovidernumber) WHERE metric_oscar_data1.metricdate BETWEEN '2002-02-28' AND '2004-02-29';
+----------+
| COUNT(1) |
+----------+
|   400000 |
+----------+
1 row in set (5.36 sec)

mysql> SELECT COUNT(1) FROM metric_oscar_data1 JOIN external_facility USING (fpn) LEFT JOIN facility ON (external_facility.fpn = facility.fprovidernumber) WHERE metric_oscar_data1.metricdate BETWEEN '2002-02-28' AND '2004-02-29' AND facility.facilityid NOT IN (1000,1001,1002);
+----------+
| COUNT(1) |
+----------+
|   162300 |
+----------+
1 row in set (1.00 sec)

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.