query

Learn SQL: Query 11: BETWEEN two DATES



Sharing buttons:

okay 11 write a sequel statement that

shows each of the employees hired

between those dates perfect access

create query sequel view okay it doesn't

say which fields to include so I'm going

to teach you something new star that

says that means give me everything

everything in that field from whatever

tables I pull it from employee I think

that's the only thing we need it the

hire date where this is a way to just

show you how to use or you know how to

get in between two dates so there are

actually a couple different ways we

could do this one would be to say or

higher oh come on where hire date is

greater than or equal to is my pound

signs hash tags every one column and

then I could say and hire date less than

or equal to whoops Troy I know 1231 2002

so whatever you do greater than or equal

to or less than or equal to don't forget

that you always do the greater than the

less than first and equal to comes

second um doesn't say how to sort them I

think that's it so let's run that one

check their hire dates perfect 97 2002

that's right

um another way to do this which is kind

of useful is I can say we're hire date

use the between operator and and then I

can get rid of

so in this case when I'm using between I

do like to put these on the same line

there you go

we're higher date between this date and

that date same thing works both very

useful