[SQL] negative queries puzzle

2002-07-31 Thread Jinn Koriech
hi all, here's a query i've never been able to improve: i have an old data set and a new data set - in this case uk postcodes with eastings and northings. i want to extract the new and changed postcodes from the new set. to get the changed entries i use a join and it works okay: SELECT n.post

[SQL] interval syntax change from 7.1.2 to 7.2.1?

2002-07-22 Thread Jinn Koriech
hi - i recently upgraded my server from 7.1.2 to 7.2.1 and now one of my apps is no longer functioning. this is the query: SELECT DISTINCT rate, sum(extract(epoch from interval (end_time - start_time)))/3600) AS duration FROM log WHERE invoice_state='8' GROUP BY rate HAV

[SQL] interval syntax change from 7.1.2 to 7.2.1?

2002-07-22 Thread Jinn Koriech
hi - i recently upgraded my server from 7.1.2 to 7.2.1 and now one of my apps is no longer functioning. this is the query: SELECT DISTINCT rate, sum(extract(epoch from interval (end_time - start_time)))/3600) AS duration FROM log WHERE invoice_state='8' GROUP BY rate HA