Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2006
    Posts
    57

    Unanswered: Getting every row that can be divided by 50

    This is kinda hard to explain but what im trying to do is get every row where the PK can be divided by 50 evenly for example

    PK
    50
    100
    150
    200
    250
    300
    350
    400
    450

    I didnt want to do a separate query for each of the rows in my program. Is there a way that sql can do this easily? I wold rater not use stored procedures.

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    SELECT * FROM yourTable
    where yourPK % 50 = 0
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

Posting Permissions

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