How do you like your SQL served? Personally I like this type:
SELECT dc.state
, dd.year
, dd.month
, sum(fs.sales) as total_sales
FROM fact_sales fs,
dim_date dd,
dim_customer dc
WHERE fs.customer_tk = dc.customer_tk
AND fs.date_tk = dd.date_tk
AND dd.year IN ( 2006, 2007 )
GROUP BY dc.state
, dd.year
, dd.month
Obviously, it’s inspired by simple star schema querying. Anything goes for me, but I kinda like a little bit of “structure” in my SQL (no pun intended), just a little bit of overview.
What’s your favorite SQL format?
Matt
P.S. We will soon be launching PDI version 2.5.0, stay tuned!