MySQL Forums
Forum List  »  Optimizer & Parser

Re: LEFT JOIN WHERE GROUP BY
Posted by: Daniel Flöijer
Date: April 02, 2012 01:24PM

Oh sorry, I didn't think it would be necessary.

What I have is for example this:
support.id = 1 (primary key)
support.statusinterlan_id = 1 (foreign key)
support.create_date = '2001-01-01 00:00:01' (datetime)

support_internalstatus.id = 1 (primary key)
support_internalstatus.name = 'Warranty' (varchar)

etc...

When I use my query I get this:

count(*), name
2, 'Warranty'
4, 'Wrong item delivered'
4, 'Exchanged'
etc

What I want is to be able to get a list of all statuses regardless if there were any support entries for that status during the specified time frame.

Ie something like this:
2, 'Warranty'
0/null, 'Warranty expired'
4, 'Wrong item delivererd'
4, 'Exchanged'

Options: ReplyQuote


Subject
Views
Written By
Posted
3189
April 02, 2012 02:51AM
1369
April 02, 2012 12:04PM
Re: LEFT JOIN WHERE GROUP BY
1385
April 02, 2012 01:24PM
1405
April 02, 2012 04:29PM
2083
April 03, 2012 12:50AM
1392
April 03, 2012 05:40PM
1503
April 03, 2012 11:22PM
1358
April 04, 2012 05:12PM
1100
April 04, 2012 11:10PM
1612
April 05, 2012 08:01PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.