CREATE TABLE services (service_id NUMBER, organization_id NUMBER, service_type_code CLOB, service_details CLOB)
CREATE TABLE things (thing_id NUMBER, organization_id NUMBER, type_of_thing_code CLOB, service_type_code CLOB, service_details CLOB)
CREATE TABLE properties (property_id NUMBER, property_type_code CLOB, property_address CLOB, other_details CLOB)
CREATE TABLE residents_services (resident_id NUMBER, service_id NUMBER, date_moved_in TIME, property_id NUMBER, date_requested TIME, date_provided TIME, other_details CLOB)
CREATE TABLE customers (customer_id NUMBER, customer_details CLOB)
CREATE TABLE residents (resident_id NUMBER, property_id NUMBER, date_moved_in TIME, date_moved_out TIME, other_details CLOB)
CREATE TABLE timed_locations_of_things (thing_id NUMBER, date_and_time TIME, location_code CLOB)
CREATE TABLE customer_events (customer_event_id NUMBER, customer_id NUMBER, date_moved_in TIME, property_id NUMBER, resident_id NUMBER, thing_id NUMBER)
CREATE TABLE customer_event_notes (customer_event_note_id NUMBER, customer_event_id NUMBER, service_type_code CLOB, resident_id NUMBER, property_id NUMBER, date_moved_in TIME)
CREATE TABLE organizations (organization_id NUMBER, parent_organization_id NUMBER, organization_details CLOB)
CREATE TABLE timed_status_of_things (thing_id NUMBER, date_and_date TIME, status_of_thing_code CLOB)

What are the distinct id and type of the thing that has the status 'Close' or has a status record before the date '2017-06-19 02:59:21
SELECT DISTINCT T2.thing_id, T2.type_of_thing_code FROM timed_status_of_things AS T1 JOIN things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.status_of_thing_code = 'Close' OR T1.date_and_date < '2017-06-19 02:59:21'
SELECT DISTINCT "T2"."thing_id", "T2"."type_of_thing_code" FROM "timed_status_of_things" "T1" JOIN "things" "T2" ON "T1"."thing_id" = "T2"."thing_id" WHERE "T1"."date_and_date" < '2017-06-19 02:59:21' OR "T1"."status_of_thing_code" = 'Close'