Re: can u help me with this select ?
From: Krzysiek (krzysiek79_at_hotmail.com)
Date: 06/02/04
- Next message: Mong: "SQL WHERE clause on text field"
- Previous message: Jyothi.D: "Parse Data while selecting"
- In reply to: Tom Moreau: "Re: can u help me with this select ?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 2 Jun 2004 08:52:26 +0200
Thanks a lot Tom ;)
Uzytkownik "Tom Moreau" <tom@dont.spam.me.cips.ca> napisal w wiadomosci
news:utsxxqzREHA.3944@TK2MSFTNGP11.phx.gbl...
> Try:
>
> create view v
> as
> select
> [datetime]
> , [int]
> , (select sum (i.[int]) from MyTable i
> where i.[datetime] <= o.[datetime]) as Total
> from
> MyTable o
> go
>
>
> --
> Tom
>
> ---------------------------------------------------------------
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinnaclepublishing.com/sql
>
>
> "Krzysiek" <krzysiek79@hotmail.com> wrote in message
> news:c9fqg9$25nt$1@news2.ipartners.pl...
> Hello All,
>
> I have a simple table with 2 columns.
>
> datetime int
> 27.05.04 1
> 29.05.04 2
> 31.05.04 5
>
> and i need to get a view that looks like this below :
>
> 27.05.04 1 1
> 29.05.04 2 3
> 31.05.04 5 8
>
> The third column shows a sum of numbers that were display before and
include
> a present one
> ..
> I was trying build stored proc however I'm not so familiar with SQL so I
> failed.. :-(
>
> can anybody help ?
>
> thx in advance
> Krzysiek
>
>
- Next message: Mong: "SQL WHERE clause on text field"
- Previous message: Jyothi.D: "Parse Data while selecting"
- In reply to: Tom Moreau: "Re: can u help me with this select ?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|