Thanks for the links. I've been playing with mysql queries for the past
few days, and it turns out that I don't need to use a join for what I want.

At first, I used a trimmed-down version of the code from rdreport.cpp in a
script that read the output file and did some calculations. It worked, but
it was slow.

This is a lot faster. I get the cart length and total play time in minutes
and the play count for the specified date range.

mysql -u "$mysql_user" -p${mysql_password} Rivendell -e "\
select CART_NUMBER,COUNT(*),ROUND(LENGTH/60000,
2),ROUND(SUM(LENGTH)/60000, 2),TITLE \
from Rivendell.Production_SRT \
where EVENT_DATETIME BETWEEN '${start_date}' AND '${end_date}'  \
GROUP BY CART_NUMBER;" > "$outfile"


Greg Avedissian


On 04/16/2016 06:29 PM, Mike Carroll wrote:
> As you dig into the wonderfulness of SQL joins, this reference might come
> in handy.  It describes the different type of joins and the result set each
> produces.
> http://www.codeproject.com/Articles/33052/Visual-Representation-of-SQL-Joins
> 
> Mike C
> 
> On Sat, Apr 16, 2016 at 2:06 PM Gregory Avedissian <[email protected]>
> wrote:
> 
>> Thanks, that's helpful. I couldn't find what I wanted all in one table, so
>> I looked at the source code for creating reports, and I found a mysql
>> command for pulling data from multiple tables at once. I think I can do
>> something with this.
>>
>> From rdreport.cpp:
>>   ...left join CART on `%s_SRT`.CART_NUMBER=CART.NUMBER...
>>
>>
>> Greg Avedissian
>>
>>
>>
>>
>> On 04/15/2016 11:56 AM, Mike Carroll wrote:
>>> I don't have an answer, but the /docs folder on GitHub has text files
>> that
>>> describe the Rivendell tables. Maybe that'll give you a lead.
>>>
>>> https://github.com/ElvishArtisan/rivendell/tree/master/docs/tables
>>>
>>> Mike C
>>>
>>> On Fri, Apr 15, 2016 at 8:42 AM Gregory Avedissian <[email protected]>
>>> wrote:
>>>
>>>> I know this has been asked before, but I'm hoping to get a different
>>>> answer. Is it possible to modify the format of reports? I'd like
>> something
>>>> that's more or less a cross between Spin Count and Technical report.
>>>>
>>>> What we need is the total time for each cart played in the past year. I
>>>> want to pull that data out each day and keep a running total. Right now,
>>>> someone is printing the Technical Report and adding the times up with
>>>> pencil and paper.
>>>>
>>>> I've been mucking around in the database with mysql commands and
>>>> mysql-workbench, but I haven't found where that information is stored.
>>>> Where do the reports get their data for what was played, start and end
>>>> times? Is there a guide to the database that tells what information is
>> in
>>>> which columns or tables?
>>>>
>>>>
>>>> Greg Avedissian
>>>> _______________________________________________
>>>> Rivendell-dev mailing list
>>>> [email protected]
>>>> http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev
>>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Rivendell-dev mailing list
>>> [email protected]
>>> http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev
>>>
>> _______________________________________________
>> Rivendell-dev mailing list
>> [email protected]
>> http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev
>>
> 
_______________________________________________
Rivendell-dev mailing list
[email protected]
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev

Reply via email to