how to include single value from another table

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
inageib
Posts: 184
Joined: Wed 26 Aug 2009 14:11

how to include single value from another table

Post by inageib » Mon 06 Apr 2015 03:30

I have two tables master table1 and detail table2

Table1 structure:

table1_id integer,
name varchar(20),
description varchar(50)


Table2 structure

table2_id integer,
table1_id integer,
price numeric(7,2),
Price_date date

I know how to link between them using join but the problem is that I want only to get the most recent price record linked to Table1 not all prices. in other words I dont want duplicates from table "Table2" but only one records contain the most recent price.

how I should write that SQL ?

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: how to include single value from another table

Post by ViktorV » Mon 06 Apr 2015 08:34

This question doesn't concern to IBDAC functionality. Please refer to the used database SQL documentation. If you have any further questions concerning our components, please contact us.

Post Reply