Get count of records from SELECT

Поиск
Список
Период
Сортировка
От Zet
Тема Get count of records from SELECT
Дата
Msg-id 5421621000.20051115175627@on.kg
обсуждение исходный текст
Ответ на Performance of a view  (John McCawley <nospam@hardgeus.com>)
Ответы Re: Get count of records from SELECT  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
Hi

I have example:

rnum := 0;
FOR r IN EXECUTE ''SELECT *
    FROM ''||table_name||''
    WHERE var = ''||var
LOOP
    IF rnum = 0 THEN
        -- how could I get the count of records here ???
        -- I tried GET DIAGNOSTICS rcount = ROW_COUNT;
        -- BUT it returns ZERO = 0 :(
    END IF;
    rnum := rnum + 1;
END LOOP;

-- here I will get count of records in "rnum", but I need in LOOP's
-- first step

Many thanx from Zet


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

Предыдущее
От: Michael Glaesemann
Дата:
Сообщение: Re: 3 x PostgreSQL in cluster/redunant
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Get count of records from SELECT