Re: Get statistics using self joins
Hi.
Yes, I'll change it SMALLINT to TINYINT UNSIGNED, thanks.
Really I'm not using multiple tables for stats, but the same table is self joined for multiple time intervals to get multiple time interval data in one query (e.g view for 14.05.09-15.05.09, 15.05.09-16.05.09, 16.05.09-17.05.09 etc). This is why you can't see any reference to stats table but in where clause. As I posted early do not need any data from main table alias, just data from joined tables. stat1, stat2 ... are not real tables but aliases of joined tables (the same sample_stats table). I'm using distinct because multiple joins return multiplied value of rows - with not unique ids.
The subquery approach seems to be more elegant to get what I wanted. I'll give it a try ASAP. I'll post results here.
Thanks for your help.
Subject
Views
Written By
Posted
6025
May 16, 2009 10:40AM
1974
May 16, 2009 07:42PM
2167
May 17, 2009 11:41AM
1991
May 17, 2009 12:32PM
Re: Get statistics using self joins
2067
May 17, 2009 12:48PM
1957
May 18, 2009 03:24AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.