-
@traq Hmm... I was hoping not to use multiple queries. If statements usually are a sign of messy/spaghetti code. Although I'm definitely sure you're better at SQL than I am, so I ask you: will using two separate queries be more efficient than using the last query? In other words, does the last query add a significant amount of wait to the execution time if all wild cards are on and we're just trying to get every single user?
Thanks for your help.
(I gaev u sum thx)
-
Trying to do everything at once can be a "messy code" trap also. The "everything" query has a series of conditionals in it, in two different spots. All of that would be run every time you query. Choosing one statement or the other would cut out some logic in one case, and all logic in the other; so I doubt the combined query would ever be "as fast," much less "faster."
But, like I said, I didn't test any of it.
-
Alright, thanks for your help and everything! I haven't tested the code, but I'm sure it works (after looking over it). I'll set this thread to resolved.
-
You're welcome. I'm not as sure as you seem to be (mostly regarding the GROUP BY clause). But if it doesn't work, it's close. Let me know if there's any problems.
-
@traq Ah, I was just going to take your suggestion and do the two separate queries.