I am making an appointment/booking app and one table holds these and a col in it marks if the appointment was booked from frontend or backand(it is ENUM with these 2 values).
I am trying to build a query here that returns the number of rows that are fronted and the number of rows that are backend.
To get an idea what I am taking about here is a query that counts the “backend” rows for a specified time interval and for a specific business user.
select count(*) from appointments
WHERE appont_close_time
BETWEEN '2016-09-01' AND '2016-09-27'
AND bookedfor=(select user_ID from users where concat(name," ",lastname) like 'kostast mpartziotis')
AND apps_origin='backend';
The above will return 5 if 5 are the backend rows.
In essence I want to get 2 numbers one for frontend and one for backend.
I hope I was clear…