Sorry, I have missed information in my earlir question, that I have added below.

> Joppe A wrote:
> 
> Hello all, Please help a newbie ;-) Have a little problem with to
> make a sql-query as I want to have it... The problem is I need to
> check in 3 tables and count out and get it presentated per "n_id"
> like
>
> n_id counted 
> 01    5 
> 02    10 
> 03    2
>
> My tables look as follows...
>
> In sub:
> id 
> n_id
>
> In us:
> id 
> email
>
> In sub_del:
> n_id 
> id
>
> My problem is that I want to be able to get out the result per
> sub.n_id and that I have to count it together, and se the result per n_id.
>
> I have since earlier a query that check the total sum of it, but that is not 
> enough...
>
>  SELECT (SELECT count(sub_id) from sub) - (SELECT count(us.id) FROM us LEFT 
> JOIN sub ON sub.id = us.id)+(SELECT count(*) FROM sub_del);
>
> As you can see I have to count all id in my sub-table and then minus the id 
> from US-table and then add what I have in sub_del-table, and listed pro n-id 
> instead of only get the total sum.

> Please help!
>
> /Joppe


-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to