A user gave me a table that looks like the following.
Name HH08 HH09 HH10 HH11 HH12 HH13
Bob 2 3 4 2 7 1
Steve 2 9 3 2 2 5
Mike 2 2 2 2 3 2
Pat 1 0 2 0 0 0
I need some sql that will select the row based on the name, and the column based on the current hour of sysdate when the query is run.
If it is 9:27 am and the user is Steve, the sql needs to select the 9 value.
Is there any simple sql that will do this, or do I need to restructure the table the user gives me, which will be occassionally.
Thanks in advance.