Hi,
I want to return specific column titles based on a certain condition from the column's values:
E.g
in the table Employees:
The type of the days is BOOLEAN -- one represents present,
zero absent,
I want using the show columns to return the days that employeeID 2 is absent, so something to this effect.
Above does not work,
but what would using show columns or not?
and in the query how can use a wildcard instead of having to repeat Monday , Tuesday, Wednesday?
Any help on the logic of this query would be appreciated.
Thanks.
I want to return specific column titles based on a certain condition from the column's values:
E.g
in the table Employees:
Code:
EmployeeID Monday Tuesday Wednesday
1 1 0 0
2 0 1 1
zero absent,
I want using the show columns to return the days that employeeID 2 is absent, so something to this effect.
Code:
show columns from Employees where EmployeeID = 2 && Monday = 0 && Tuesday =0 && Wednesday = 0
but what would using show columns or not?
and in the query how can use a wildcard instead of having to repeat Monday , Tuesday, Wednesday?
Any help on the logic of this query would be appreciated.
Thanks.
Comment