You could join the table to itself twice, ie Table2.ID=Table1.ID-1 and
Table3.ID=Table1.ID-2, and only display every third record using something
like WHERE Table1.ID%3=0.  (where % is the modulo operator)

So you would have something like:
 
SELECT t1.Name, t2.Name, t3.Name 
FROM Table t1 
        JOIN Table t2 ON t2.ID=t1.ID+1
        JOIN Table t3 ON t3.ID=t1.ID+2
WHERE t1.ID % 3 = 1

(untested)

There might be issues if your IDs are not consecutive, but otherwise
something like that should work.

Paul Ritchie
Radio Computing Services.


> -----Original Message-----
> From: Donovan J. Edye [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 27 March 2001 12:12 p.m.
> To: Multiple recipients of list delphi
> Subject: [DUG]: [Q] Ideas for DB Issue?
> 
> 
> G'Day,
> 
> I am looking for some ideas on how to tackle a rather simple issue:
> 
> If we have the following table:
> 
> ID
> Name
> 
> 1,One
> 2,Two
> 3,Three
> 4,Four
> 5,Five
> 6,Six
> 7,Seven
> 8,Eight
> 
> Let's just say that we wanted to display 3 records at a time 
> and that we
> wanted to display them __horizontally__. So:
> 
> One       Two     Three
> 
> And if we scroll
> 
> Four      Five      Six
> 
> And if we scroll
> 
> Seven     Eight
> 
> Obviously normalised db data does not lend itself well to 
> this. I realise
> that to achieve the above I could either:
> 
> - Have non bound edit boxes and then transfer their changes 
> to the dataset
> - Create an in memory dataset with the representation I need and then
> transfer this to the actual dataset
> 
> However both of these require an intermediary step. I was wondering if
> anyone could suggest something else. Ideally I want some DB controls
> directly bound. Essentially a DB grid that works horizontally 
> instead of
> vertically when scrolling through data.
> 
> Any ideas no matter how wacky appreciated. ;-)
> 
> -- Donovan
> ----------------------------------------------------------------------
> Donovan J. Edye [www.edye.wattle.id.au]
> Namadgi Systems [www.namsys.com.au]
> Voice: +61 2 6285-3460
> Fax: +61 2 6285-3459
> TVisualBasic = Class(None);
> Heard just before the 'Big Bang': "...Uh Oh...."
> ----------------------------------------------------------------------
> GXExplorer [http://www.gxexplorer.org] Freeware Windows Explorer
> replacement. Also includes freeware delphi windows explorer 
> components.
> ----------------------------------------------------------------------
> 
> 
> --------------------------------------------------------------
> -------------
>     New Zealand Delphi Users group - Delphi List - 
> [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED] 
> with body of "unsubscribe delphi"
> 
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to