I have a table called UDF which contains data linked to the data found in another table called CLIENT.
This data in UDF is in groups specified by the column UDF.UDFINDEX. I have linked these two tables by
WHERE udf.udjoin = client.clnum
This has not been a problem in that I have asked it to return results where UDF.UDFINDEX = '7' and I get a single result back for each client record.
What I want now is to return a result where UDF.UDFINDEX = '7' and '56' but there is no record that will contain both of those numbers as each one is an individual record.
So you might have a layout like this
UDJOIN UDFINDEX UDDATE UDVALUE
10001 7 08072009 NULL
10001 56 NULL TMS
10002 56 NULL TMS
When I query this:
...WHERE udf.udfindex = '7' or udf.udfindex = '56'
There are thousands of rows where the UDFINDEX will equate to 56 and I get a load of results back I do not want.
I want a single row for each UDJOIN that contains the value of 56 and 7 in the results.
This has been really hard to try and explain. Please let me know if you have NO idea what I am talking about.
Thanks
This data in UDF is in groups specified by the column UDF.UDFINDEX. I have linked these two tables by
WHERE udf.udjoin = client.clnum
This has not been a problem in that I have asked it to return results where UDF.UDFINDEX = '7' and I get a single result back for each client record.
What I want now is to return a result where UDF.UDFINDEX = '7' and '56' but there is no record that will contain both of those numbers as each one is an individual record.
So you might have a layout like this
UDJOIN UDFINDEX UDDATE UDVALUE
10001 7 08072009 NULL
10001 56 NULL TMS
10002 56 NULL TMS
When I query this:
...WHERE udf.udfindex = '7' or udf.udfindex = '56'
There are thousands of rows where the UDFINDEX will equate to 56 and I get a load of results back I do not want.
I want a single row for each UDJOIN that contains the value of 56 and 7 in the results.
This has been really hard to try and explain. Please let me know if you have NO idea what I am talking about.
Thanks