Write a query to display the meter_number from the meter table which got maximum total_units during 8PM for a day in the electricity_reading.

Question

Write a query to display the meter_number from the meter table which got maximum total_units during 8PM for a day in the electricity_reading.
🧐 Not the exact question you are looking for?Go ask a question

Solution 1

Sure, here is a SQL query that should give you the desired result:

SELECT meter_number 
FROM meter 
JOIN electricity_reading 
ON meter.id = electricity_reading.meter_id 
WHERE TIME(electricity_reading.reading_time) = '20:00:00' 
GROUP BY meter_number 
ORDER BY SUM(electricity_reading.total_u
    Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study prob
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study problem.
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study problem.
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study problem.
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solv

This problem has been solved

Similar Questions

Write a query to display the meter_number from the meter table which got maximum total_units during 8PM for a day in the electricity_reading.

Write a query to display the total_units and payable_amount of the particular meter number 'SG934826

Write a query to display the number of electricity_reading in which the total_units per day is greater than 500. Give an alias name as 'count_total_units_500'.

Write a query to display the total_units, payable_amount and fine_amount of bill table. Display the records in descending order based on their total_units

Write a query to display all the details of the 'meter' whose meter_number starts with 'S' and ends with '6'.

1/3