Ashley Sheridan;11020629 wrote:Are there no other fields that accompany these rows? Something that at least identifies the row? Typically there will be something that makes each row unique. This is what I would do:
SELECT COUNT(*) as total
FROM table
GROUP BY field_full_of_1s_and_0s
There is. Basically what I'm looking to do is count the number of occurrences in-between a circumstance that happened during a specific event. There's the event name, and an id # for each for each event, as well as several fields signified by either 0 for no, or 1 for yes. NogDog had a good idea and I'm working on expanding on that, but it's the main query that I'm still struggling with. SELECT count(*) was the one I tried, but I'm having counting the in-between rows.
So basically it's set up like this:
eventname
open
closed
id
So in other words, if I was looking to count the number of days in a row a specific event (there are multiple ones in the database) was open (1) vs closed (0), that's what I'm trying to accomplish, as well as the number of consecutive days since it was last closed 🙂