Re: PLEASE HELP !!! Looking for SQL command - Mailing list pgsql-general

From Gerard H. Pille
Subject Re: PLEASE HELP !!! Looking for SQL command
Date
Msg-id 3E14A58C.9000609@skynet.be
Whole thread Raw
List 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


pgsql-general by date:

Previous
From: "Jeroen T. Vermeulen"
Date:
Subject: Re: [HACKERS] Cast your vote ...
Next
From: "Peter Depuydt"
Date:
Subject: Datatype SET or enumeration type ?