Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7429673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:00:32+00:00 2026-05-29T09:00:32+00:00

I realize this is fairly abstract, but I’d like to do something not unlike

  • 0

I realize this is fairly abstract, but I’d like to do something not unlike Remember The Milk’s smart lists:
http://www.rememberthemilk.com/help/answers/search/advanced.rtm

I have a set of user stories that are tagged, categorized, etc., and I’m seeing that it would be of huge advantage to have user-customizable “views” or “smart lists” to return a specific set of stories. This makes the workflow of using the app quite flexible and useful for many unforeseeable scenarios.

I have no problem right now with simple OR queries:

WHERE tag = "tag1" OR tag = "tag2" OR category = "category1" OR category = "category2"

But that’s really not as useful as mixed AND/OR conditions:

WHERE (tag = "tag1" OR tag = "tag2") AND category = "category1"

So, the apparent issues are:

  1. Nested conditions
  2. Mixing AND/OR conditions in the same query
  3. Making this “query abstraction” syntax more-or-less human readable, easily stored/parsed, URL query string friendly, etc.

To make matters worse, simple OR conditions can be handled quite well within a where clause, but AND (compound conditions) seem to require an additional join per condition, and I’m lost how to organize this in sustainable code.

I’m using PHP/MySQL, but this doesn’t seem to be so platform specific.

To summarize, I’d like to find a sustainable approach to parsing and converting a human-generated sequence of conditions into SQL.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:00:34+00:00Added an answer on May 29, 2026 at 9:00 am

    An abstract question deserves an abstract answer. 🙂 Alas, I’m going to give you an example of how another piece of software handles this problem, because I’m not very philosophical.

    Request Tracker is a long-established browser-UI trouble ticketing system. It has a tremendously powerful ticket search mechanism that knows how to read every possible field associated with a ticket, and lets you effectively craft your entire SQL query via the web interface.

    I couldn’t find any screenshots of the search page, so perhaps you might want to look at the online demo of RT. Log in, then from the menu at the top-left of your window, select “Ticket” then “New Search”.

    Or better yet, to see how ALL searches are built on this search tool, click on a queue from the list on the right-hand side of the main demo screen (which shows up right after you log in). When you have a set of tickets showing, click on “Tickets” at the top of your window. (Not a menu option that comes up. Just click Tickets.)

    The query builder here shows the structure of your query on the right, and lets you mix-and-match things to include in it using controls on the left. And if you’re an “advanced” user and want to write your own query manually, or clean up something that the web UI is having problems with, you can click the Advanced link at the top and edit something that looks remarkably like SQL.

    I won’t get in to how to JOIN other tables in. I’m answer this as if it’s a UI/UX question, not a data modelling one. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I realize this question has probably been asked numerous times, but I have not
I realize there are other threads addressing this problem but as I am fairly
I realize this is syntactically bad but I figure it somewhat explains what I'm
I realize this is more of a hardware question, but this is also very
I realize this is a rather odd request, but I was wondering if anyone
I realize this is probably a hopelessly newbie question, but what is the difference
I realize this is a basic question but I have searched online, been to
I realize this sounds a little crazy, but I'm working on a project for
I realize this question is pretty basic, but I'm really stuck. I have a
I realize this is a duplicate of about 20 different posts, but none of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.