Finishing off 'query2*' scripts
Database/hosts_list.tpl, Database/hosts_showcount.sqlite.sql: examples of using 'query2tt2' Database/query2csv, Database/query2json, Database/query2tt2: minor bug fix relating to '-dbarg=ARG' option
This commit is contained in:
15
Database/hosts_showcount.sqlite.sql
Normal file
15
Database/hosts_showcount.sqlite.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
--
|
||||
-- Query for use with 'query2tt2' to generate a list of hosts who contributed
|
||||
-- shows in a particular year. Designed to be used with the 'hosts_list.tpl'
|
||||
-- template.
|
||||
-- The two '?' placeholders in the query are to be filled with 'YYYY-01-01'
|
||||
-- for the start of the year and 'YYYY-12-31'. The values can be passed using
|
||||
-- the '-dbargs' option to 'query2tt2'.
|
||||
--
|
||||
SELECT DISTINCT
|
||||
printf('%04d',h.hostid) AS hostid, h.host AS hostname
|
||||
FROM eps e
|
||||
JOIN hosts h ON e.hostid = h.hostid
|
||||
WHERE e.date BETWEEN ? AND ?
|
||||
AND title != 'Reserved'
|
||||
ORDER BY h.host
|
Reference in New Issue
Block a user