Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    New Coder
    Join Date
    Jul 2007
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That looks quite a neat solution. Thanks.

    One possible problem I can see, though, is that I was hoping to use this query as a view, which would greatly simplify the main query, but I was reading on the MySql help site that views don't allow sub-queries in the From clause.

    Is there a way that I could encapsulate this query, so I could call it from the From clause of the main query, which would do the range comparisons of the degree columns with the input parameters, hence a table would need to be returned, rather than a variable from a procedure?

    Debbie
    QuicknEasySalesPro.com - your quick and easy, yet powerful solution for managing your membership site sales, downloads and affiliates.

  2. #17
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,436
    Thanks
    75
    Thanked 4,372 Times in 4,337 Posts
    Again, given the complexity of what you are doing, I'd be sorely tempted to use a stored procedure that would put your results into a TEMPORARY TABLE. So you would call the procedure and then use your own code to JOIN to the temp table created by the procedure.

    So long as this is all done on the same open connection, the temporary table will (a) be only visible on that connection and (b) remain available until you drop it or until the connection is closed.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


 
Page 2 of 2 FirstFirst 12

Posting Permissions

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