Patent ID: 7363297

Claim:
A computer implemented method for retrieving data, comprising: providing a plurality of conditional constraints, wherein each constraint is programmatically generated by execution of a constraint generation routine that performs a constraint generation operation, comprising: issuing a first query to retrieve distinct values for a first field; receiving results for the first query, the results comprising the distinct values for the first field; for each of the distinct values for the first field, issuing a second query configured to retrieve, for a second field, a result set that satisfies a first condition comprising the first field related to the distinct value by an operator; determining whether a correlation exists between (i) the respective distinct value of the first field and (ii) a respective result set value of the second field; and if a correlation exists, defining a conditional constraint for the first field based on the correlation, wherein the conditional constraint specifies the addition of a second condition to a query if the query includes the respective first condition, wherein the second condition includes the second field related to the respective result set value by an operator; receiving a query; for each conditional constraint of the plurality of conditional constraints: determining whether the query satisfies the conditional constraint; and if the query satisfies the conditional constraint, adding the respective second condition corresponding to the satisfied conditional constraint to the query to produce a modified query; executing the modified query; and returning results for the modified query.