SQL non values

shamas21

Registered User.
Local time
Today, 17:47
Joined
May 27, 2008
Messages
162
Hi All

How can i incorporate all Letters that names.id <> left(forename,1)

SELECT names.id, count(left(forename,1)) as count
FROM customers, names
WHERE names.id = left(forename,1)
GROUP BY names.id

at the moment it returns

A 1
B 3
E 5

but i want it to show all the values, i.e.

A 1
B 3
C 0
D 0
E 5

Thanks
 
Maybe this:


SELECT names.id, count(left(forename,1)) as count
FROM names
LEFT JOIN customers ON names.id = left(forename,1)
GROUP BY names.id
 
Deleted this post
 

Users who are viewing this thread

Back
Top Bottom