Name Username Day worked Time period
----------------------------------------------
John Doe john Sunday 8
Tom tom Monday 10
Jane Doe jane Tuesday 5
John Doe john Friday 9
Query:
SELECT username FROM table WHERE (day_worked='Sunday' AND time_period>5) AND (day_worked='Friday' and time_period>8)
Here I am applying conditions for two columns, user who worked on Sunday more than 5 hours and Friday more than 8 hours. So obviously John Doe (Username: john) meets the condition and it should be outputted.
However this does not return anything. May be the logic I am using is wrong. Any ideas?