How to check all rows

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default How to check all rows

    Hi there. If some one can tell me how to check that all rows in the column have
    same value. For example all team played 10 games, so in the column games all
    rows must have value 10. And if all rows have value 10 then another action can
    be performed.

    Thanks in advance.
    Andrey


    trukhin Guest

  2. Similar Questions and Discussions

    1. How to retrieve first 50 rows , next 50 rows and so on in Informix
      Hi All Is there any equivalent command for SET ROWCOUNT or LIMIT in INFORMIX to get the first 50rows, next 50 rows and so on if query returns...
    2. Spell Check and Grammer Check
      Hello, Does anybody know about some good spell checker/grammer checker for html/asp pages? Thank you, Regards, Raj.
    3. Turning off Check in / Check out feature
      How can I turn off the check in / check out feature? Can't seem to find it in the Contribute HELP. Thanks!
    4. Check to see if Check Boxes are Checked
      How do I check to see if a checked box is check on the following page? This is what I have. What am I doing wrong? <%If...
    5. Select rows where other related rows don't exist
      I would like to select rows from a table where another related row in the same table doesn't exist and the relation key is more than 1 column. ...
  3. #2

    Default Re: How to check all rows

    Something like this would give you a count of rows where the column wasn't 10.
    Any result other than zero means that there are rows where the games value is
    not 10. You will get a zero if the games column in all of the rows is 10. (You
    will also get a zero if there are no rows at all in the table, or ALL games are
    NULL, but otherwise this should give you what you are looking for.)

    SELECT COUNT(*)
    FROM YourTable
    WHERE games <> 10
    OR games IS NULL
    AND
    EXISTS(SELECT 1
    FROM Your_table
    WHERE games = 10)

    Phil

    paross1 Guest

  4. #3

    Default Re: How to check all rows

    Thank you very much Phil, it is good idea.
    trukhin Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139