Query Group By Hour
Posted in 2008
Topics: SQL Development & Query Writing
Hi i m new in informix.i would like to create a report, which show record by hourly. i trying to do a query by group by hour. But i fail to find any method. eg: Defect Code Hour Total Input ------------------------------------------- D1 7 45 D1 8 56 D1 9 10 D1 10 69 Anyone got idea for this? Thanks in advance
kisetsukee@gmail.com said:
> Hi
>
> i m new in informix.i would like to create a report, which show record
> by hourly.
> i trying to do a query by group by hour. But i fail to find any
> method.
>
> eg:
>
> Defect Code Hour Total Input
> -------------------------------------------
> D1 7 45
> D1 8 56
> D1 9 10
> D1 10 69
SELECT defect_code, hour, sum(input)
FROM table
WHERE whatever
GROUP BY 1, 2
ORDER BY 1, 2
???
--
Bye now,
Obnoxio
"There were a myriad of problems which conspired to corrupt your reason
and rob you of your common sense. Fear got the best of you, and in your
panic you turned to the Labour Party. They promised you order, they
promised you peace, and all they demanded in return was your silent,
obedient consent."
Obnoxio The Clown wrote:
> kisetsukee@gmail.com said:
>> Hi
>>
>> i m new in informix.i would like to create a report, which show record
>> by hourly.
>> i trying to do a query by group by hour. But i fail to find any
>> method.
>>
>> eg:
>>
>> Defect Code Hour Total Input
>> -------------------------------------------
>> D1 7 45
>> D1 8 56
>> D1 9 10
>> D1 10 69
>
> SELECT defect_code, hour, sum(input)
> FROM table
> WHERE whatever
> GROUP BY 1, 2
> ORDER BY 1, 2>
> ???
>
If this doesn't solve the issue we'll need some table schema and a few lines of
the data...
Regards