Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2003
    Posts
    21

    Unanswered: numerical difference

    sorry for the newbie question;

    Is there an easy way to calculate the numerical difference between 2 columns?
    columnA - columnB

    Thanks

  2. #2
    Join Date
    Jul 2003
    Location
    US
    Posts
    314

    Arrow diff

    select (columnA - columnB) difference from table where ....;
    TaR
    Aruneesh

  3. #3
    Join Date
    Jul 2003
    Posts
    21
    what if i have a query like the following:

    select a as p1, b as p2, from table ...

    both p1 and p2 are numbers

    is there a way to go:

    select a as p1, b as p2, (p1 +p2) as total from ...

  4. #4
    Join Date
    Jul 2003
    Location
    US
    Posts
    314

    Lightbulb No

    Hi
    No. You cannot write a query of the following format
    select a as p1, b as p2, (p1 +p2) as total from ...

    The reason for this, the system wouldnt know about the columns p1 and p2. The system only recognzies columns a and b.

    TaR
    Aruneesh

  5. #5
    Join Date
    Nov 2002
    Location
    Desk, slightly south of keyboard
    Posts
    697
    but you can do

    select a as p1, b as p2, (a + b) as total from ....

    Bill

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •