Greg
Greg

Reputation: 31

Struggling with a query, join, in

I am struggling with a query. And wondering if someone could help.

I have a table of tags (service request tickets) and a table of serial numbers

From my tags I am doing this

Select * from tag 
where
tag.created
BETWEEN '2012-9-01'
AND '2012-12-29' 
and
tag.tagtype <> 'service'

Now, i would like to join with serialnumber (table) where (not sure inner/outer or just join)

tag.serialnumberid is in serialnumber.id and serialnumber .modelid = 80

I am thinking it should be easy. Any help would be appreciated

Upvotes: 0

Views: 33

Answers (1)

ethrbunny
ethrbunny

Reputation: 10469

Select * from tag 
join serialnumber on tag.serialnumberid = serialnumber.id
where
   tag.created BETWEEN '2012-9-01' AND '2012-12-29' 
     and
  tag.tagtype <> 'service'
     and serialnumber.modelid = 80;

Upvotes: 1

Related Questions