db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Morton <djmorto...@yahoo.com>
Subject Re: Problem with sql statement , can some one help me to get count of a complex select ?
Date Mon, 08 May 2006 01:14:46 GMT
Assuming your query works the way it is suppsoed to
(ie. when you run the query, it returns the correct
rows) then you should be able to do:

SELECT COUNT(*) 
FROM categories 
WHERE categories.categoryid NOT IN
( 
  SELECT DISTINCT categoriescategoryid 
  FROM BANNER_categories 
  WHERE BANNERBANNERID = 10
)

Which is slightly different from the 3 examples you
listed.

Hope this helps.

Dan Morton

> 
> SELECT * FROM categories   WHERE
> categories.categoryid NOT IN
>     ( SELECT DISTINCT categoriescategoryid 
>     FROM BANNER_categories WHERE BANNERBANNERID =
> 10)
>
> if we think this statement is A then i tried :
> I tried :
> select count(*) from (A)
> select count(A)
> select count(*) , A
> ....
> 
> but still i can not find this statement total
> returning rows.
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Mime
View raw message