AK-85
03-10-2010, 10:20 AM
Hi everybody,
I have a database in Access and one of my queries has 7 SELECT statements. The problem is that I have multiple inheritance and I have to retrieve information from the super most class and combine it with information from the sub most class but I change the primary key. It looks something like this:
The result from the previous SELECT statments has one nr column and then I have B(*id_U, nr) -> A(data1, data2, id).
So to say, I have in the result some numbers, that corespond to data1 and data2 in A via the nr and id. I have to output nr, data1, data2. How can I do that? I can output only data1 and data2, but how do I add the nr?
SELECT A.data1, A.data2
FROM A
WHERE A.id IN (SELECT B.id_U
FROM B
WHERE B.nr IN (SELECT ...));
Thanks in advance!
I have a database in Access and one of my queries has 7 SELECT statements. The problem is that I have multiple inheritance and I have to retrieve information from the super most class and combine it with information from the sub most class but I change the primary key. It looks something like this:
The result from the previous SELECT statments has one nr column and then I have B(*id_U, nr) -> A(data1, data2, id).
So to say, I have in the result some numbers, that corespond to data1 and data2 in A via the nr and id. I have to output nr, data1, data2. How can I do that? I can output only data1 and data2, but how do I add the nr?
SELECT A.data1, A.data2
FROM A
WHERE A.id IN (SELECT B.id_U
FROM B
WHERE B.nr IN (SELECT ...));
Thanks in advance!