🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.interbase.sql
1 messages
1 total messages Started by DP Thu, 12 Dec 2002 11:21
JOIN and max query
#11231
Author: DP
Date: Thu, 12 Dec 2002 11:21
29 lines
1667 bytes
Hello

I asked something similar to this in the past, but even with the previous
answer, this slight variation has me stumped (not hard to do)

TableA
A_ID  integer
Text varchar(100);

TableB
B_ID      integer
A_ID      integer
Price       integer
Changed TIMESTAMP

For every A_ID, I'd like the latest price (deduced by 'Changed') from
Table_B.  There could be multiple(or zero) entries for A_ID in TableB.

I need the following columns:  A.A_ID,  A.Text,  B.Price, B.Changed

where  B.Price, B.Changed are the most recent entry in Table B.

I can guess that the query should have a max and possibly some 'group by'
statements, but it's knowing where to put them.  Any hints greatly
appreciated.

TIA

David
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads