How do you implement this simple scenario with the least possible cost (SQL) ?
(implement a stored procedure supporting all combinations of the filters applied.)
Table
name | dateOfbirth | phone | email
N1 | 01-01-1992 | P1 | E1
N2 | 12-08-1976 | P2 | E2
N3 | 09-11-1989 | P3 | E3
N4 | 04-06-1991 | P4 | E4
Filter
[x] Name
[x] dateOfbirth
[x] phone
[x] email
After seeing SQL queries and filters implemented for many years and in many ways.
I think it’s high time for me to refresh.
References
Mark / Correct this question if found as duplicate
Whenever I do optional filters, I choose some data that will represent all data, and then use something like this: