Read count ?

Поиск
Список
Период
Сортировка
От Aarni Ruuhimäki
Тема Read count ?
Дата
Msg-id 200502241717.14648.aarni@kymi.com
обсуждение исходный текст
Ответы Re: Read count ?  (Ragnar Hafstað <gnari@simnet.is>)
Список pgsql-sql
Hi,

Could someone please give a hint on how to query the following neatly ?

Get news from a news table that belong to a particular account, get segment 
name from segments table for each news item and read count from read history 
table that gets a news_id and timestamp insert every time the news is read. 
Display everything by news count, most read news first ?

news_id 4, news_header, segment_name x, read 10 times
news_id 2, news_header, segment_name y, read 8 times
news_id 1, news_header, segment_name x, read 7 times
news_id 3, news_header, segment_name x, read 0 times

news_table:
news_id, account_id, segment_id, news_header, ...

segments_table:
segment_id, account_id, segment_name

read_history_table:
history_id, news_id, timestamp


TIA,

Aarni
--------------
This is a bugfree broadcast to you
from **Kmail**
on **Fedora Core 2** linux system
--------------


В списке pgsql-sql по дате отправления:

Предыдущее
От: "Mark Roberts"
Дата:
Сообщение: Postgres 8 - Database access, new install.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Advanced SELECT