Re: [SQL] sum an alias

2010-06-03 Thread A. Kretschmer
In response to Wes James : > In the statement: > > select > MAX(page_count_count) - MIN(page_count_count) as day_tot, > MAX(page_count_count) as day_max, sum(MAX(page_count_count) - > MIN(page_count_count)) as tot, > page_count_pdate > from page_count > group by page_count_pdate order

[SQL] sum an alias

2010-06-03 Thread Wes James
In the statement: select MAX(page_count_count) - MIN(page_count_count) as day_tot, MAX(page_count_count) as day_max, sum(MAX(page_count_count) - MIN(page_count_count)) as tot, page_count_pdate from page_count group by page_count_pdate order by page_count_pdate Is there a way to do sum

Re: [SQL] inner join and limit

2010-06-03 Thread Harald Fuchs
In article <4bfd5bc0.90...@unipex.it>, Michele Petrazzo - Unipex writes: > Hi list, > I have two table that are so represented: > t1: > id int primary key > ... other > t2: > id int primary key > t1id int fk(t1.id) > somedate date > ... other > data t1: > 1 | abcde > 2 | fghi > data t2: > 1 |