Re: variables in SQL??
От | DalTech - CTE |
---|---|
Тема | Re: variables in SQL?? |
Дата | |
Msg-id | 00ee01c0077b$12e763e0$5911be86@cte.Dal.Ca обсуждение исходный текст |
Ответ на | variables in SQL?? ("Francisco Hernandez" <xy0xy0@earthlink.net>) |
Список | pgsql-sql |
> what im trying to do is have a Sum of a colum.. as it goes forwards I don't think this is what you want, but I suppose it might help.... Table = simple +----------------------------------+----------------------------------+----- --+ | Field | Type | Length| +----------------------------------+----------------------------------+----- --+ | price | int4 | 4 | +----------------------------------+----------------------------------+----- --+ => select price,count(price) from simple group by price; price|count -----+----- 1| 4 2| 7 4| 8 5| 5 7| 16 9| 1 10| 12 (7 rows) => create view simple_v as select price,count(price) from simple group by price; CREATE 19503 1 => select * from simple_v; price|count -----+----- 1| 4 2| 7 4| 8 5| 5 7| 16 9| 1 10| 12 (7 rows) => insert into simple (price) values (5); INSERT 19504 1 => select * from simple_v; price|count -----+----- 1| 4 2| 7 4| 8 5| 6 7| 16 9| 1 10| 12 (7 rows)
В списке pgsql-sql по дате отправления: