POV-Ray : Newsgroups : povray.off-topic : SQL question : Re: SQL question Server Time
29 Sep 2024 15:25:47 EDT (-0400)
  Re: SQL question  
From: scott
Date: 11 Mar 2009 06:05:16
Message: <49b78cdc$1@news.povray.org>
> OK, what *precisely* are you trying to count?
>
> 2. The number of experiments where event X occurred at least once?

This one ^ the number of experiments where event X occurred at least once.

In my first post I said what I had got already:

SELECT ExpID FROM Table WHERE EventID=1 GROUP BY ExpID

This gives me a list of unique ExpIDs where event X occurred at least once. 
I simply want it to return the count of those returned rows rather than the 
rows themselves, so I just want a single number returned.  This will then be 
divided by the total number of experiments in the database, to give a % of 
experiments where event X occurred one or more times.

> Well, you could always store the SQL in the database itself! ;-)

Cunning :-)  Although it would need to be a separate database, as currently 
I'm keeping the option open for the user to specify database file to create 
and use, so if they want they can keep several separate databases and my app 
just works on one of them at a time.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.