David Johnston wrote
>
> Janek Sendrowski wrote
>> Hi,
>>
>>
>>
>> thanks for all your answers.
>>
>> I'll have a try with the contains operator and the intrange, but
>> before I'd like to know if this would work:
>>
>>
>>
>> CASE WHEN a >= 0 AND a < 25
>>
>> CASE WHEN a >= 25 AND
Janek Sendrowski wrote
> Hi,
>
>
>
> thanks for all your answers.
>
> I'll have a try with the contains operator and the intrange, but
> before I'd like to know if this would work:
>
>
>
> CASE WHEN a >= 0 AND a < 25
>
> CASE WHEN a >= 25 AND a < 50
>
>
>
> There wouldn't be a
Hi,
thanks for all your answers.
I'll have a try with the contains operator and the intrange, but before I'd like to know if this would work:
CASE WHEN a >= 0 AND a < 25
CASE WHEN a >= 25 AND a < 50
There wouldn't be a double endpoint. I just have to decide which range the endpoint i
BladeOfLight16 wrote
> Then again, I guess you don't need a nested query.
>
> SELECT v_rec1.user,
> CASE WIDTH_BUCKET(v_rec_fts.lev, 0, 100, 4)
> WHEN 1 THEN '0 to 25'
> WHEN 2 THEN '25 to 50'
> WHEN 3 THEN '50 to 75'
> WHEN 4 THEN '
On Sun, Aug 25, 2013 at 8:36 PM, BladeOfLight16 wrote:
> This appears to be some kind of equal interval problem.
>
> SELECT v_rec1.user,
> WIDTH_BUCKET(v_rec_fts.lev, 0, 100, 4) AS bucket
> COUNT(*) as count,
> FROM v_rec2
> GROUP BY user, bucket;
>
> (Untested, but this should be
On Sun, Aug 25, 2013 at 5:59 PM, Janek Sendrowski wrote:
> SELECT v_rec1.user,
> sum(CASE WHEN v_rec_fts.lev BETWEEN 0 AND 25 THEN 1 ELSE 0 END) as
> "0 to 25",
> sum(CASE WHEN v_rec_fts.lev BETWEEN 25 AND 50 THEN 1 ELSE 0 END)
> as "25 to 50",
> sum(CASE WHEN v_rec_fts.l
Janek Sendrowski wrote
> Sorry, I formulated it wrong.
>
> My problem is, that I want to count the ranges for every user, but if I
> use count(range), it counts the ranges of all users.
Assuming your example output is indeed what you desire:
SELECT user, '0 to 25'::varchar AS percentage, count
Sorry, I formulated it wrong.
My problem is, that I want to count the ranges for every user, but if I use count(range), it counts the ranges of all users.
Janek Sendrowski
Janek Sendrowski wrote
> Hi,
>
> Thats my code snipped:
>
> SELECT v_rec1.user,
> sum(CASE WHEN v_rec_fts.lev BETWEEN 0 AND 25 THEN 1 ELSE 0 END) as
> "0 to 25",
> sum(CASE WHEN v_rec_fts.lev BETWEEN 25 AND 50 THEN 1 ELSE 0 END)
> as "25 to 50",
> sum(CASE WHEN v_rec_fts
Hi,
Thats my code snipped:
SELECT v_rec1.user,
sum(CASE WHEN v_rec_fts.lev BETWEEN 0 AND 25 THEN 1 ELSE 0 END) as "0
to 25",
sum(CASE WHEN v_rec_fts.lev BETWEEN 25 AND 50 THEN 1 ELSE 0 END) as "25
to 50",
sum(CASE WHEN v_rec_fts.lev BETWEEN 50 AND 100 THEN 1 ELSE 0 END
10 matches
Mail list logo