2007-03-02 19:16:45 +00:00
|
|
|
<h1>Labels and SQL Expressions</h1>
|
2005-11-27 10:56:53 +00:00
|
|
|
|
2007-03-02 19:16:45 +00:00
|
|
|
<p>Labels are generated by using SQL expressions. The «SQL expression» is added to WHERE clause of view feed query. You can match on ttrss_entries table fields and even use subselect to query additional information. This functionality is considered to be advanced and requires some understanding of SQL.</p>
|
2005-11-27 10:56:53 +00:00
|
|
|
|
|
|
|
<h2>Examples</h2>
|
|
|
|
|
|
|
|
<p>Match all unread articles:</p>
|
|
|
|
|
2008-01-11 07:18:19 +00:00
|
|
|
<code>unread = true</code>
|
2005-11-27 10:56:53 +00:00
|
|
|
|
|
|
|
<p>Matches all articles which mention Linux in the title:</p>
|
|
|
|
|
2008-01-11 07:18:19 +00:00
|
|
|
<code>ttrss_entries.title like '%Linux%'</code>
|
2005-11-27 10:56:53 +00:00
|
|
|
|
2008-01-11 07:06:04 +00:00
|
|
|
<p>Matches all articles for the last week (PostgreSQL):</p>
|
2005-11-27 10:56:53 +00:00
|
|
|
|
2008-01-11 07:18:19 +00:00
|
|
|
<code>updated > NOW() - INTERVAL '7 days'</code>
|
2008-01-11 07:06:04 +00:00
|
|
|
|
2008-04-30 11:52:35 +00:00
|
|
|
<p>Matches all articles with scores between 100 and 500:</p>
|
|
|
|
|
|
|
|
<code>score > 100 and score < 500</code>
|
|
|
|
|
2008-01-11 07:06:04 +00:00
|
|
|
<p>See the database schema <a target="_blank" href="http://tt-rss.org/trac/browser/schema/ttrss_schema_pgsql.sql">here</a> or included in the distribution package for gruesome details. The relevant tables are <b>ttrss_entries</b> and <b>ttrss_user_entries</b>.</p>
|
|
|
|
|
|
|
|
<p class="insensitive">Feel free to post more clever examples of labels on Tiny
|
|
|
|
Tiny RSS <a target="_blank" href="http://tt-rss.org/forum">forums</a>.</p>
|