Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2005
    Posts
    3

    Post Unanswered: Simple, must be simple :)

    Need for help

    simple query

    select docsum, agent
    from tb1

    so far so good
    but now is need for one more column (the third one), where docsum >500
    Please, any suggestions

  2. #2
    Join Date
    Feb 2004
    Location
    Dublin, Ireland
    Posts
    212
    specify clearly what you need:

    1) Select just rows where docsum > 500

    2) Select all rows but display docsum only for these rows where docsum > 500?

    In first case use:
    Code:
    select docsum, agent
    from tb1
    where docsum > 500
    In second case, you can use more options depends on database server e.g. on oracle:

    Code:
    select 
    case when docsum <= 500 then
     null
    else
     docsum
    end docsum,
    agent
    from tb1

  3. #3
    Join Date
    Oct 2005
    Posts
    3
    Thank`s madafaka, the second case i was looking for

Posting Permissions

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