|Subject||left join / first row select|
I try to solve this problem already few days without success.
I am using WI-V22.214.171.124540 Firebird 2.5 (windows 7).
I have two tables:
As a results I would like to have
So idea is I combine TABLE 1 and TABLE 2 based on CON_ID_1 and CON_ID_2 but in table2 I can have few identical rows with the same CON_ID_2 value.
I tried to use such query
SELECT * FROM DATA_SUMMARY a
>left joinunfortunetly it gives only NULL in the data_view tables part.
>(select first 1 * from DATA_VIEW) as c on c.CON_ID_2=a.CON_ID_1
I cannot use DISTINCT(c.CON_ID_2) option because it take 2.5 min to sort complete table (both tables have few thousand rows)
On the internet I found only solutions for oracle and mysql but it doesn't for FB
Any suggestions how to solve such problem?
Thanks for any feedback