sneakyimp wrote:
The original query results (minus most of the fields but including the
COUNT(esa.id) part) would look something like this:
id title subcat_count
60 Another Halloween Party 4
50 Satan's Midnight October Bash 1
61 Halloween IPN Testing party 1
19 test 1
64 I happen more
chris smith-9 wrote:
What mysql version are you using? I wonder if you can use this part as a
subquery and then:
select sum(foo) as total from (SELECT COUNT(*) AS count
FROM demo_event_time_assoc eta,
demo_events e,
demo_event_subcategory_assoc esa,
sneakyimp wrote:
See this query? I need a separate query that will return ONLY the total
record count that it would come up with. I've tried replacing the select
part with COUNT() but I still get a series of records in my return result.
I just need ONE return value -- the total COUNT of rows
sneakyimp wrote:
chris smith-9 wrote:
Doing this is actually rather easy.
Replace this:
SELECT e.id, e.title, e.subheading, eta.start_timestamp,
eta.end_timestamp, e.zip, e.bold, e.outline, e.color, e.subheading,
COUNT(esa.id) AS subcat_count
With:
SELECT COUNT(e.id) AS count
Or am I
chris smith-9 wrote:
Ah - that would be the group by doing that.
Removing those:
GROUP BY eta.id ORDER BY subcat_count DESC, eta.id
Does that get you what you want?
If it gives you one result - make sure it's right. Change a few id's,
make sure they match up to what your other
sneakyimp wrote:
chris smith-9 wrote:
Ah - that would be the group by doing that.
Removing those:
GROUP BY eta.id ORDER BY subcat_count DESC, eta.id
Does that get you what you want?
If it gives you one result - make sure it's right. Change a few id's,
make sure they match up to what your
The original query results (minus most of the fields but including the
COUNT(esa.id) part) would look something like this:
id title subcat_count
60 Another Halloween Party 4
50 Satan's Midnight October Bash 1
61 Halloween IPN Testing party 1
19 test 1
64 I happen more than once today 1