Hi

I have not much experience with crosstab queries (pioting). I did som
research on the net, but could not find andy good examples on how to
do this through HQL and hibernate. Thus I was wondering if I could get
some help with my problem.

I have two tables:
datarecord: (id, time) where id is PK
datavalue(id,rec_id,value,type) where id is PK and rec_id and type_id
is FK.

Record example:
1 - 12:00:00
2 - 16:00:00

Values:
1 - 1 - 4.5 - A
2 - 2 - 6.5 - A
3 - 2 - 6.7 - C
4 - 2 - 7.7 - B
5 - 2 - 1.7 - C

Then I would like to make a query that select specific types and get
value of the specific type in its seprate column.
Example result when requesting the value of type A and B (not
including C) would be:
(time, value of A, value of B)
12:00:00 - 4.5 - null
16:00:00 - 6.5 - 7.7


The number of types that can be selected is dynamic since the query
would be used from a userinterface to select which data to view in
graphs.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to