count

Typo3: How to count page impressions on every page with an extension

I need to count the page impressions of every page on a typo3 site into the db. So I think I need an extension which is called on every page impression and increase a column 'impressions' in the db of the specific page. I'm new to typo3 and new to extension development as well. Is there a way to include an extbase-extension on every pa...

how does the groupby and count work in sql

1> select browser,count(*) from logtest group by browser; +-----------+----------+ | browser | count(*) | +-----------+----------+ | Firefox 3 | 14 | | Unknown | 11 | +-----------+----------+ 2 rows in set 2> select browser,count(browser) from logtest group by browser; +-----------+----------------+ | browser | cou...

MySQL: List students (Sname) who enrolled in more than 6 (distinct) classes in a term.

Given the schema: Student(Snum, Sname) Course(Cnum, Cname) Prerequisite(Cnum, Prereq) Professor(Pnum,Pname, Dept, Office) Enrollment(Snum, Cnum, Term, Section, Mark) Schedule(Cnum, Term, Section, Days, Time, Room) Class(Cnum, Term, Section, Instructor) I have come up with: SELECT * FROM Student s HAVING MIN( SELECT COUNT(*) FROM ...

count(*) where cond = val, or count(cond = val)

What is the difference between these two methods? select count(*) from `table` where `column` = 'value'; and select count(`column` = 'value') from `table`; To me they seem to do the same thing; I assume this is not the case for the database. Does one method leverage indexes better than the other? In this case I use MySQL but a gen...

python - how to get the numebr of active threads started by specific class ?

code looks like below: class workers1(Thread): ... def __init__(self): ... Thread.__init__(self) ... def run(self): ... ...do some stuff class workers2(Thread): ... def __init__(self): ... Thread.__init__(self) ... def run(self): ... ...do some stuff if __name__ == "__main__": ... start workers while ...

MySQL Select And Count Date Range: Doesn't work crossing the month barrier

Hi Can you please tell me why this works: $customer_data_date14daysAgo = mysql_query("SELECT COUNT(*) AS count FROM tableName WHERE datetime BETWEEN '$date14daysAgo%' and '$dateToday%' ") or die(mysql_error()); But this doesn't? $customer_data_date30daysAgo = mysql_query("SELECT COUNT(*) AS count FROM tableName WHERE datetime BE...

Selecting two counts on two joins in one query

create table Autorzy(ID int, imie varchar, nazwisko varchar); create table Wydawnictwa(ID int, nazwa varchar, adres varchar, tel varchar); create table Ksiazki(ID int, ISBN bigint, wydawnictwo_id int, data date, ilosc int, tytul varchar); create table KsiazkaAutor(ID int, autor_id int, ksiazka_id int); create table Recenzje (id int, tres...

Simple query optimization

Hey guys, forgive me if this is too simple a question. I basically want a count of the number of males and females in a database. So I know two simple queries will accomplish this, such as: select count(*) from table where gender='male' select count(*) from table where gender='female' However, this seems very inefficient since I know ...