Unix Technical Forum

Calculation in a view

This is a discussion on Calculation in a view within the MySQL forums, part of the Database Server Software category; --> Hello all. I would like to make a view, but rather than viewing the actual content of the record, ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 10:49 AM
Mad Ant
 
Posts: n/a
Default Calculation in a view

Hello all.

I would like to make a view, but rather than viewing the actual
content of the record, I would like to calculate the difference
between 2 values (such as the difference of price between 2 products).
I would rather not have to pass through a second table, and would like
to know if it is possible to place the calculation in the creation
sequence of the view.

Many thanks,

Anton

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 10:49 AM
ZeldorBlat
 
Posts: n/a
Default Re: Calculation in a view

On May 14, 9:16 am, Mad Ant <anton.har...@gmail.com> wrote:
> Hello all.
>
> I would like to make a view, but rather than viewing the actual
> content of the record, I would like to calculate the difference
> between 2 values (such as the difference of price between 2 products).
> I would rather not have to pass through a second table, and would like
> to know if it is possible to place the calculation in the creation
> sequence of the view.
>
> Many thanks,
>
> Anton


Yes.

Did you try it?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 10:49 AM
lark
 
Posts: n/a
Default Re: Calculation in a view

Mad Ant wrote:
> Hello all.
>
> I would like to make a view, but rather than viewing the actual
> content of the record, I would like to calculate the difference
> between 2 values (such as the difference of price between 2 products).
> I would rather not have to pass through a second table, and would like
> to know if it is possible to place the calculation in the creation
> sequence of the view.
>
> Many thanks,
>
> Anton
>


yes, certainly you can do this.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:03 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com