hi,
I have the following sceaio I want to write a query for, but can't think how to do it (assuming it is possible)
(well, i've simplified here to get to the point I want)
Imagin I have a 'rules' and a 'rule instruction' table as follows:
rules
-----
rule_code
rule_description
rule_instructions
-----------------
rule_code
instruction_seqno
instruction_text
what I want to be able to do is write a query that returns a single string comprising of the concatonated 'instruction_text' entries for a give rule
for example:
image the rule instruction table contains:
rule_code instruction_seqno instruction_text
--------- ----------------- -----------------
rule1 1 pick one of these
rule1 2 from each group
rule1 3 but not both
rule2 1 pick as many as you like
rule2 2 upto the maximum cost
what i would like is a seelct statement (or to write a view) that would return :
pick one of these from each group but not both
if i feed it 'rule1'
or
pick as many as you like upto the maximum cost
if I feed it 'rule2'
is this possible?
thanks,
andy
I have the following sceaio I want to write a query for, but can't think how to do it (assuming it is possible)
(well, i've simplified here to get to the point I want)
Imagin I have a 'rules' and a 'rule instruction' table as follows:
rules
-----
rule_code
rule_description
rule_instructions
-----------------
rule_code
instruction_seqno
instruction_text
what I want to be able to do is write a query that returns a single string comprising of the concatonated 'instruction_text' entries for a give rule
for example:
image the rule instruction table contains:
rule_code instruction_seqno instruction_text
--------- ----------------- -----------------
rule1 1 pick one of these
rule1 2 from each group
rule1 3 but not both
rule2 1 pick as many as you like
rule2 2 upto the maximum cost
what i would like is a seelct statement (or to write a view) that would return :
pick one of these from each group but not both
if i feed it 'rule1'
or
pick as many as you like upto the maximum cost
if I feed it 'rule2'
is this possible?
thanks,
andy