DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Select

  1. #1
    Join Date
    Mar 2001
    Posts
    52

    Smile

    Hello Smart Guys,

    I have to retrieve data from a table ( my_table), which has 2 columns, year and count

    Select year1.count ,
    year1.count-year2.count
    From my_table year1,my_table year2;

    I tried union but I do not get all the info.

    Thanks

    Donna

  2. #2
    Join Date
    Jun 2001
    Location
    Chicago
    Posts
    2
    I don't understand. Your subtracting what year from what year?

  3. #3
    Join Date
    Mar 2001
    Posts
    52
    The idea is to substact 2 rows from the same table

    col1
    ------
    row1
    row2


    select col1.row1- col1.row2
    from my_table;

Posting Permissions

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


Click Here to Expand Forum to Full Width