I have a table
id_user, hour, medition 1 0 100 1 1 101 1 14 102 2 5 108 2 17 103
How I can complete the inexistent hours with a 0 value for any user?
example
1 0 100 1 1 101 1 2 0 1 3 0 ...
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
build a table hours, populate it with the numbers from 1 to 24, then use this to query with an outer join against your primary table. – replace nulls with 0
edit to add quick example: