December 28th, 2012, 04:28 PM
Struggling with a query
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
tag.tagtype <> 'service'
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
December 28th, 2012, 08:48 PM
if you could please do a SHOW CREATE TABLE for each table please, i can help you with the sql
December 30th, 2012, 07:40 AM
assuming you just want the data that there's an entry for in both tables, it should be something like this:
if you also want the tags that have no matching serialnumber, you would use Left Join.
If you also want the serial numbers that have no corresponding tags, you would use Right Join