Re: Help with a view

Поиск
Список
Период
Сортировка
От Leif B. Kristensen
Тема Re: Help with a view
Дата
Msg-id 200509222012.15463.leif@solumslekt.org
обсуждение исходный текст
Ответ на Re: Help with a view  ("Dmitri Bichko" <dbichko@aveopharma.com>)
Ответы Re: Help with a view  (Rajesh Kumar Mallah <mallah.rajesh@gmail.com>)
Список pgsql-sql
On Thursday 22 September 2005 20:03, Dmitri Bichko wrote:

> SELECT * FROM principals WHERE event = 15821 AND person != 2?

Sure, that's a concise answer to what I actually wrote, but it wasn't 
exactly what I intended :)

Basically, what I've got is the first person and the tag_type. I can do 
it with a function from PHP:

function get_spouses($p) {   $handle = pg_query("select person from principals                      where event in
(selectevent from principals                      where person = $p and tag_type = " .MARR. ")
orderby sort_date");   $i=0;   $spouses = array();   while ($row = pg_fetch_row($handle) {       if $row[0] != $p
    $spouses[$i++] = $row[0];   }   return $spouses;
 
}

But this is *ugly* ...
-- 
Leif Biberg Kristensen
http://solumslekt.org/


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

Предыдущее
От: "Dmitri Bichko"
Дата:
Сообщение: Re: Help with a view
Следующее
От: Daryl Richter
Дата:
Сообщение: Re: Updating cidr column with network operator