Re: [firebird-support] Help needed with grouping, GROUP BY and LIST()

2016-08-29 Thread Mike Ro miker...@gmail.com [firebird-support]
On 29/08/2016 00:28, 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support] wrote: What’s performance like? So far I have only tested with a very limited set of data (approx. 30 records) so haven't noticed any performance issues. FlameRobin reports sub 0.01s times! The maximum number

RE: [firebird-support] Help needed with grouping, GROUP BY and LIST()

2016-08-28 Thread 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]
Mike, What’s performance like? Sean From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] Sent: August 28, 2016 5:25 PM To: firebird-support@yahoogroups.com Subject: Re: [firebird-support] Help needed with grouping, GROUP BY and LIST() Sean, Have a look at my

Re: [firebird-support] Help needed with grouping, GROUP BY and LIST()

2016-08-28 Thread Mike Ro miker...@gmail.com [firebird-support]
Sean, Have a look at my reply to your second question, about using CTE, that will be part of your answer for this problem as well. FYI: LIST() doesn't observe ORDER BY... Thanks to your hint and example CTE I was able to get my query fully working as follows. Sorry, there are a couple of

Re: [firebird-support] Help needed with grouping, GROUP BY and LIST()

2016-08-26 Thread Mike Ro miker...@gmail.com [firebird-support]
Hi Sean, Look at using Common Table Expressions (CTE) Here is a rough sample based on your details Thank you for the pointer to CTE and the example. I have only looked at CTE briefly once before (for representing tree structures), so it will take me some time to do some reading and to

RE: [firebird-support] Help needed with grouping, GROUP BY and LIST()

2016-08-26 Thread 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]
> > Q: Did you mean to exclude the 2nd "HIGH_FLOW" characteristic value from > > the summary? > > Yes, the same information should not be repeated within a single 'field'. The > second "HIGH_FLOW" characteristic is only in the original result set because > it > has 2 properties (> 10 litres /

RE: [firebird-support] Help needed with grouping, GROUP BY and LIST()

2016-08-26 Thread 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]
Mike, > Q2. How can I create a further table J_RESULT_GROUP and query for > arbitrarily grouping results together where any distinct elements are LIST()ed > whilst common elements are 'GROUP'ed (i.e. appear only once). For > example if J_RESULT_GROUP had 2 rows: > GROUP TEST > 1    2 > 1    44 >

Re: [firebird-support] Help needed with grouping, GROUP BY and LIST()

2016-08-26 Thread Mike Ro miker...@gmail.com [firebird-support]
Hi Sean, thank you for your answer. Some questions before I can give a suggestion: > TEST_IDJFI_IDF_NAMEN1_NAMEN2_NAME MODECHARACTERIST > ICPROPERTY > 11FLOW_1NODE_ANODE_BMODE_1 HIGH FLOW> 10 litres / > sec > 11FLOW_1NODE_A

RE: [firebird-support] Help needed with grouping, GROUP BY and LIST()

2016-08-26 Thread 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]
Mike, Some questions before I can give a suggestion: > TEST_ID    JFI_ID    F_NAME    N1_NAME    N2_NAME    MODE    CHARACTERIST > IC    PROPERTY > 1    1    FLOW_1    NODE_A    NODE_B    MODE_1    HIGH FLOW    > 10 litres  / > sec > 1    1    FLOW_1    NODE_A    NODE_B    MODE_1    HIGH FLOW   

[firebird-support] Help needed with grouping, GROUP BY and LIST()

2016-08-26 Thread Mike Ro miker...@gmail.com [firebird-support]
I am modeling some abstract flow tests. A 'flow instance' is defined as some sort of flow from Node A to Node B. This is simply modeled with 3 tables as follows (I have left out the alter table add constraints for brevity): CREATE TABLE FLOW ( ID integer NOT NULL PRIMARY KEY, NAME