adding function, module to database

2002-09-07 Thread Mehdi Roomi
Hi, suppose there is a database with lots of tables. I want to add a function to this database to return the following SQL query: SELECT SUM(IF(HOUR(start)>'02:00:00' AND HOUR(stop)<='08:00:00',50*sessiontime,0)+IF(HOUR(start)>'08:00:00' AND HOUR(stop)<='14:00:00',100*sessiontime,0)+IF(HOUR(sta

complex sql query...

2002-09-05 Thread Mehdi Roomi
Hi, Suppose there is a sql table with the following fields and values: +-+ |username|start|stop |sessiontime| ++-+--+---+ |mehdi | 2002-08-12