Re: PLEASE HELP !!! Looking for SQL command

From: "Gerard H(dot) Pille" <ghp(at)skynet(dot)be>
To: D C Patel <dcpatel(at)hss(dot)hns(dot)com>
Subject: Re: PLEASE HELP !!! Looking for SQL command
Date: 2003-01-02 20:48:12
Message-ID: 3E14A58C.9000609@skynet.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

D C Patel wrote:
> Hi,
> I have a table which has a field "session-id" & a variable length field.
> The table is updated with entries for different session-id's.
>
> I want to know if there is a command by which I can calculate
> the total size (in bytes) for all entries corresponding to a "session-id".
>
> In other words
>
> For (i = 1 to Number of rows corresponding to the session-id )
> {
> Total Size = Total Size + Size of (All elements in row[i])
> }
>
> Regards,
> D C Patel

select sum(length(var_length_field)) from the_table_i_have where
session_id = a_session_id;

--

Gerard H. Pille

Browse pgsql-general by date

  From Date Subject
Next Message Dan Langille 2003-01-02 21:21:18 Re: new project - PostgresSQL based voting script
Previous Message greg 2003-01-02 20:43:57 Re: new project - PostgresSQL based voting script