Insert Value based on One Column based on Value on another Column
What you are trying to do is to create a computed column and I am pretty sure MySQL does not support them. There are a few ways around this issue:


Do the computation in the logic that inserts the data
Create a trigger on the table to do the calculation when data is inserted/updated
Create a view to represent the data how you want it.


My personal preference would be to use a view as it is easier to maintain as is a much neater solution. Your view would look something like this:

CREATE VIEW `vwHelp`
AS
SELECT `_ID`, `_date`,
CASE
   WHEN HOUR(`_date`) &lt;10 THEN 1
   WHEN HOUR(`_date`) &lt;16 THEN 2
   WHEN HOUR(`_date`) &lt;24 THEN 3
   ELSE -1
END AS `_timestamp`
FROM `help`;