SQLize Online / PHPize Online

A A A
Share   Donate   Blog   Popular
Copy Format Clear
CREATE TABLE gaz( id_emp int, name_emp varchar(128), id_region int, job_id int, hire_date date ); insert into gaz ( name_emp, id_region, job_id, hire_date ) values ('Medvedev', 1, 1, '2022-01-06'), ('Pavlov', 3, 4, '2022-01-15'), ('Kashina', 3, 2, '2021-02-07'), ('Ivansheva', 4, 3, '2019-06-01'), ('Deryabin', 2, 5, '2021-05-25'), ('Ezroh', 1, 4, '2020-04-01'), ('Malitsky', 1, 1, '2020-04-01'), ('Gref', 1, 5, '2020-04-01'), ('Shurlakova', 1, 2, '2020-04-01'), ('Chernienko', 1, 3, '2020-04-01'); select name_emp, ( select count(*) from gaz gaz_count where gaz.hire_date < DATEADD(MONTH, -6, hire_date) ) from gaz ;
Stuck with a problem? Need help? Ask professionals on our Telegram channel!
Join the channel
Your quersion is posted.
Join our Telegram channel and get answers.
Send
Copy