total newbie question

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

total newbie question

От:
"Tad Naworal" <tnaworal@syssrc.com>
Дата:
Hi,

I'm trying to add some numeric columns together

select (stotal + ltotal) as total from table where cusid='12123';

 
I searched the docs and could not find an answer.
any help would be greatly appreciated

thanks
Tad

Re: total newbie question

От:
Stephan Szabo <sszabo@megazone23.bigpanda.com>
Дата:
On Tue, 12 Jun 2001, Tad Naworal wrote:

> Hi,
> 
> I'm trying to add some numeric columns together
> 
> select (stotal + ltotal) as total from table where cusid='12123';
> 
>  
> I searched the docs and could not find an answer.
> any help would be greatly appreciated

That should work, what are you seeing?


Re: total newbie question

От:
John Burski <john.burski@911ep.com>
Дата:
Your syntax is just a bit off.  Try something like

select (column1 + column2) as "Sum" from tablename where cusid = '12123';

It works for me.


Tad Naworal wrote:

> Hi,
>
> I'm trying to add some numeric columns together
>
> select (stotal + ltotal) as total from table where cusid='12123';
>
>
> I searched the docs and could not find an answer.
> any help would be greatly appreciated
>
> thanks
> Tad
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl

--
John Burski
I.T. Manager and Systems Administration
911EP
First in LEDs... The solid state warning light leader.
1-800-863-6911



Re: total newbie question

От:
Peter Eisentraut <peter_e@gmx.net>
Дата:
Tad Naworal writes:

> I'm trying to add some numeric columns together
>
> select (stotal + ltotal) as total from table where cusid='12123';
>
> I searched the docs and could not find an answer.
> any help would be greatly appreciated

That's not a question, that's a statement.  ;-)
What is your question?

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter

Re: total newbie question

От:
Nils Zonneveld <nils@mbit.nl>
Дата:


Peter Eisentraut wrote:
> 
> Tad Naworal writes:
> 
> > I'm trying to add some numeric columns together
> >
> > select (stotal + ltotal) as total from table where cusid='12123';
> >
> > I searched the docs and could not find an answer.
> > any help would be greatly appreciated
> 
> That's not a question, that's a statement.  ;-)
> What is your question?

It could be he's trying to add up a integer and a float?

Nils
FAQ