Hey,
I’m doing some stats on how many music videos where recorded in the
previous week by using the following sql query:
select DATE_FORMAT(creation_date - interval 1 day, ‘%Y-%m-%d’) as date,
count(artist) as total
from music_videos
group by DATE_FORMAT(creation_date - interval 1 day, ‘%Y-%u’)
order by date desc
it basically produces a date and a number
2005-06-01 39
I’d like to use this data in rails to create a table and a graph, but i
have no idea how to get the data in since this data doesn’t match any of
my models.
so my question is do i
a)Create a model and somehow map the queries across to create the
instances
b)Pull in the sql(somehow) directly and parse the results line by line
c)something I haven’t thought of?
This is the first time i’ve come across this, so i’d like to find out
best practice etc
thankyou