Subject | Re: [IBO] Ordering by lookup column ? |
---|---|
Author | slsolutions2002 |
Post date | 2002-01-29T14:59:46Z |
--- In IBObjects@y..., Geoff Worboys (TeamIBO) <geoff@t...> wrote:
I am new to SQL and IBO so I a sure I am doing something wrong but I
set up as a join as follows:
SELECT *
FROM COSTCATEGORYDETAIL,
COSTCATEGORYDEFINITIONS
COSTCATEGORYNAME WHERE
COSTCATEGORYNO=COSTCATEGORYNO
Here is the problem. I now get the description and can sort on it
but the records are being duplicated. In the COSTCATEGORYDETAIL
table there are 5 records. In the COSTCATEGORYDEFINITIONS table
there are 50 records. Before the grid contained only the 5 records
in the COSTCATEGORYDETAIL table as is correct. Now, with my SQL, the
grid contains 5 records for each entry in the COSTCATEGORYDEFINITIONS
table (250 records) . Can you tell me the proper SQL to use to
simply pull the CATEGORYNAME from the COSTCATEGORYDEFINITIONS table
for each entry in the COSTCATEGORYDETAIL table.
Thanks
> > Is it not possible to order on this column ?Hello Geoff:
>
> Not as an embedded select, setup as a join instead.
>
> --
> Geoff Worboys - TeamIBO
> Telesis Computing
I am new to SQL and IBO so I a sure I am doing something wrong but I
set up as a join as follows:
SELECT *
FROM COSTCATEGORYDETAIL,
COSTCATEGORYDEFINITIONS
COSTCATEGORYNAME WHERE
COSTCATEGORYNO=COSTCATEGORYNO
Here is the problem. I now get the description and can sort on it
but the records are being duplicated. In the COSTCATEGORYDETAIL
table there are 5 records. In the COSTCATEGORYDEFINITIONS table
there are 50 records. Before the grid contained only the 5 records
in the COSTCATEGORYDETAIL table as is correct. Now, with my SQL, the
grid contains 5 records for each entry in the COSTCATEGORYDEFINITIONS
table (250 records) . Can you tell me the proper SQL to use to
simply pull the CATEGORYNAME from the COSTCATEGORYDEFINITIONS table
for each entry in the COSTCATEGORYDETAIL table.
Thanks