Atten SQL query masters:
Hello, I have a table of events, the table has an id field, a date field, a name field and a priority field.
My goal is to get the next four events based on the date, however if there is an event in the table that has a high priority I would like to display that one even tho there are events that have an earlier date.
in other words if I have four unimportant events this week , and one incredibly important event a month from now. I would like to SELECT the first 3 events from this week and the incredibly important event as the 4th? How would i use an event's priority field to bump events that come before it but still remain in chronological order with the other 3 events?
thank you
Hello, I have a table of events, the table has an id field, a date field, a name field and a priority field.
My goal is to get the next four events based on the date, however if there is an event in the table that has a high priority I would like to display that one even tho there are events that have an earlier date.
in other words if I have four unimportant events this week , and one incredibly important event a month from now. I would like to SELECT the first 3 events from this week and the incredibly important event as the 4th? How would i use an event's priority field to bump events that come before it but still remain in chronological order with the other 3 events?
thank you