summaryrefslogtreecommitdiff
path: root/help/1.php
blob: b0dfb63e1f710670602b1673ca39ee7a2c9bdd66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<h1>Labels and SQL Expressions</h1>

<p>Labels are generated by using SQL expressions. The &laquo;SQL expression&raquo; 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>
	
<h2>Examples</h2>

<p>Match all unread articles:</p>

<pre>unread = true</pre>

<p>Matches all articles which mention Linux in the title:</p>

<pre>ttrss_entries.title like '%Linux%'</pre>

<p>Matches all articles for the last week (PostgreSQL):</p>

<pre>updated &gt; NOW() - INTERVAL '7 days'</pre>

<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>