Dont use test. db

This commit is contained in:
proller 2019-04-22 14:48:37 +03:00
parent 96e4e389b7
commit a9bc78d559
2 changed files with 5 additions and 8 deletions

View File

@ -1,6 +1,5 @@
CREATE DATABASE IF NOT EXISTS test;
DROP TABLE IF EXISTS test.one;
CREATE TABLE test.one(dummy UInt8) ENGINE = Memory;
DROP TABLE IF EXISTS one;
CREATE TABLE one(dummy UInt8) ENGINE = Memory;
SELECT database, t.name
FROM system.tables AS t
@ -91,4 +90,4 @@ SELECT count()
JOIN system.databases AS db ON db.name = t.database
WHERE t.name = 'one';
DROP TABLE test.one;
DROP TABLE one;

View File

@ -1,5 +1,3 @@
USE test;
DROP TABLE IF EXISTS appointment_events;
CREATE TABLE appointment_events
(
@ -29,11 +27,11 @@ SELECT A._appointment_id,
A._vacancy_id,
A._set_at,
A._job_requisition_id
FROM test.appointment_events A ANY
FROM appointment_events A ANY
LEFT JOIN
(SELECT _appointment_id,
MAX(_set_at) AS max_set_at
FROM test.appointment_events
FROM appointment_events
WHERE _status in ('Created', 'Transferred')
GROUP BY _appointment_id ) B USING _appointment_id
WHERE A._set_at = B.max_set_at;