good day
Help form a request. There is a bill table (MySQL) in it the following fields:
- 1: id
- 2: id_importance
- 3: date_start
It is necessary to select the entire record in a certain range in the date_start field (say +/- 7 days), but if the id_importance record is 7, then we select them in a different range (say +/- 20 days).
All this must be done in a single request. Is it possible?
UNIONorUNION ALL.... that is, in general, the query will be as(SELECT ... WHERE id_importance != 7) UNION (SELECT ...... WHERE id_importance = 7)- Alexey Shimansky