Re: PLEASE HELP !!! Looking for SQL command

Поиск
Список
Период
Сортировка
Искать

Re: PLEASE HELP !!! Looking for SQL command

От:
"Gerard H. Pille" <ghp@skynet.be>
Дата:
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

FAQ