List:General Discussion« Previous MessageNext Message »
From:Joppe A Date:March 1 2005 3:21pm
View as plain text  
Hello all,

I have I small problem I wonder if there is a easy solution for..

I have a SQL-query where I count out how many users per "n_id" I have. it is a little
tricky because I had to do a left joint and compare two tables to get out thoose that are
represented only in one of the tables.

SELECT SUBS.NE_ID, count(*) from SUBS left join SUB on SUBS.SC_ID=SUB.SC_ID WHERE 
SUB.SC_ID is NULL group by SUBS.NE_ID;

The result I get out looks like this

NE_ID  count
01      10
02      11
03      4
04      8

And now to my problem, I would like to count this together with another table I have
instead of have a seperate query and count them together manually...
SELECT count(*) from SUBS_DEAC where NE_ID=01

I want to have these extra query added in my first query and get out the result as above
(but now are SUBS and SUBS_DEAC counted together)

I can also mention that my MySQL db is version 3.23.55. Unfortunatly is no update to newer
version at the moment planed... 

Would be greatfull to get some help!


Sign-up for Ads Free at

problems...Joppe A1 Mar
  • Re: problems...SGreen1 Mar