Multiple WHERE clauses in a Query

0 Kam N. · July 6, 2015
Hi everyone, I'm still fairly new to SQL, I was wondering what is the best way to to have two WHERE clauses in one query? I have a table that has columns time, name,shift. I want to say pick everything from the table between date 1 to take 10 and also want only ones where there shift is 'A' shift.


SELECT 
t_stamp,
name'
shift,
FROM Monthly
WHERE
t_stamp BETWEEN 'Date 1' AND 'Date 10' AND shift = 'A'

Or can i somehow use UNION

SELECT 
t_stamp,
name'
shift,
FROM Monthly
WHERE
t_stamp BETWEEN 'Date 1' AND 'Date 10'
UNION
SELECT 
t_stamp,
name'
shift,
FROM Monthly
WHERE
shift = 'A';

I'd appreciate the help. Thanks in advance 

Post a Reply

Replies

- page 2
Oldest  Newest  Rating
0 mike richardson · July 9, 2015
NP and good luck!! Hit me up if you need anything :)
  • 1
  • 2

SQL & Databases

107,252 followers
About

Everything SQL and Databases related in here!

Links
Moderators
Bucky Roberts Administrator