selecting on different criteria for each row

Results 1 to 3 of 3

Thread: selecting on different criteria for each row

  1. #1
    Thierry Sommelet Guest

    Default selecting on different criteria for each row

    I need to select records in a table based on a criteria which is different for each row in the table.<BR>For example I have an applicant to several schools, and i need to test a different criteria for each school in order to select the subset of schools ready to accept the student.<BR>This criteria is fixed for each school, and I thought of directly storing it as a SQL query in a field of the school table.<BR><BR>What query can I then use to select all the schools for which this criteria is met ??<BR><BR>I tried creating a stored procedure which evaluates the query, but I can&#039t find a way to use the result of this sp in another query.

  2. #2
    iyyappan n iyer Guest

    Default Loop thru rs

    create a rs of the whole table and loop thru it, top to bottom and check for conditions , and if ok then store record id in array at end display results.<BR><BR>

  3. #3
    Thierry Sommelet Guest

    Default RE: Loop thru rs

    Thanks. However, I am trying to do the whole thing in SQL in order to avoid sending data back and forth from the ASP server to the DB server. I could do the equivalent of looping thru the rs using a cursor, but I was wondering whether there was a more efficient method

Posting Permissions

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