Re: counting question

2005-08-01 Thread Dean Karres
Thanks to all that responded about my counting question. Gleb Paharenko's solution using the sub-select and the LEFT JOINS was the closest to what I needed. All the best, Dean...K... -- Dean Karres / karres at itg dot uiuc dot edu / www.itg.uiuc.edu Im

Re: counting question

2005-08-01 Thread Gleb Paharenko
Hello. What do you think about this: SELECT u.name, IFNULL(s.skill_name,'user doesn\'t have any skill') AS SKILL, ( SELECT COUNT(skill_id)

Re: counting question

2005-07-31 Thread Enrique Sanchez Vela
I could not help to resist to create the tables and try the hint, which is pretty close to the working solution. I just had to replace "order by user.id" with "group by user.name skill.skill_name" regards, esv. --- Parag Agrawal <[EMAIL PROTECTED]> wrote: > Try this out: > > select user.nam

Re: counting question

2005-07-31 Thread Parag Agrawal
Try this out: select user.name, skill.skill_name, count(user_skill1.skill_id) from user , skill, user_skill , user_skill as user_skill1 where user.id=user_skill.user_id and user_skill.skill_id=skill.id and skill.id = user_skill1.skill_id order by user.id. I think this would work. -- Parag B

counting question

2005-07-30 Thread Dean Karres
Hi, I have three simple tables: user { id int PRIMARY name varchar UNIQUE } skill { id int PRIMARY skill_name varchar UNIQUE } user_skill { user_id int skill_id int UNIQUE KEY id (user_id, skill_id) } Each user can have zero or more associated skills. So you might have these a

RE: Counting question

2003-07-03 Thread Andy Eastham
Try this: select delivery, count(*) as ticketcount from ticketsales where delivery="post" or delivery="pickup" group by delivery Andy > -Original Message- > From: Ville Mattila [mailto:[EMAIL PROTECTED] > Sent: 03 July 2003 11:28 > To: [EMAIL PROTECT

Counting question

2003-07-03 Thread Ville Mattila
Hi there, We are currently having a large festival here in Ikaalinen, Finland (www.satahamesoi.fi) and we have our booking system based on MySQL. I should find out how many tickets are sold in each concert with different delivery methods. How could I make a count like this: SELECT COUNT(delivery=