Groups | Search | Server Info | Login | Register


Groups > comp.databases > #88

Re: joining tables and the order changes

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.glorb.com!news.astraweb.com!border6.newsrouter.astraweb.com!not-for-mail
From Ben Finney <bignose+hates-spam@benfinney.id.au>
Newsgroups comp.databases
Subject Re: joining tables and the order changes
References <96356369-58eb-4a52-a72b-1687558871e1@e17g2000prj.googlegroups.com>
X-Public-Key-ID 0xAC128405
X-Public-Key-Fingerprint 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405
X-Public-Key-URL http://www.benfinney.id.au/contact/bfinney-pubkey.asc
X-Post-From Ben Finney <bignose+hates-spam@benfinney.id.au>
Date Thu, 23 Jun 2011 07:47:28 +1000
Message-ID <8739j1pmhb.fsf@benfinney.id.au> (permalink)
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)
Cancel-Lock sha1:28ueFLZYOtxqImG3BeeLqH7IrFs=
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
Lines 30
Organization Unlimited download news at news.astraweb.com
NNTP-Posting-Host 212caa47.news.astraweb.com
X-Trace DXC=fSiX1CT[K\EMnc]O[a9m]EL?0kYOcDh@JSBc;\8ijUdK:F=AP1hJGNMUGD@iN[Hd?OhD>jS_18g;N
Xref x330-a1.tempe.blueboxinc.net comp.databases:88

Show key headers only | View raw


shawrie <tourerukcom@googlemail.com> writes:

> When i display records from deal basket for a specific deal number it
> displays the record fine. When i create a view and link the 2 tables
> by product code so i can display description the order of records
> change????

One possibility is that the problem is caused by too many question
marks :-)

Another is that you've forgotten that SQL result sets are allowed to
come back in *any* order, and can change from one moment to the next,
unless you use an ‘ORDER BY’ clause.

> How can i display the records in the dealsbasket in the order they
> were imported into the table

The RDBMS has no obligation to even remember what order they were
inserted into the table. Most will not, instead optimising storage
internally for speed purposes.

If you want the records to have a particular sequence, then you need
them to have a field which can be the subject of an ‘ORDER BY’ clause.
Likely candidates are the real-world identifier for the product or deal.

-- 
 \       “Following fashion and the status quo is easy. Thinking about |
  `\        your users' lives and creating something practical is much |
_o__)                                harder.” —Ryan Singer, 2008-07-09 |
Ben Finney

Back to comp.databases | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

joining tables and the order changes shawrie <tourerukcom@googlemail.com> - 2011-06-22 07:44 -0700
  Re: joining tables and the order changes Ben Finney <bignose+hates-spam@benfinney.id.au> - 2011-06-23 07:47 +1000
  Re: joining tables and the order changes Arthur Ward <art.ward@noreply.xx> - 2011-06-23 08:50 +0000
    Re: joining tables and the order changes David Kerber <dkerber@WarrenRogersAssociates.invalid> - 2011-06-23 09:09 -0400
      Re: joining tables and the order changes Arthur Ward <art.ward@noreply.xx> - 2011-06-23 13:23 +0000
        Re: joining tables and the order changes David Kerber <dkerber@WarrenRogersAssociates.invalid> - 2011-06-23 14:35 -0400
    Re: joining tables and the order changes toledobythesea@yahoo.ca - 2011-06-24 10:40 -0700
      Re: joining tables and the order changes Arthur Ward <art.ward@noreply.xx> - 2011-06-25 12:33 +0000
        Re: joining tables and the order changes paul c <toledobythesea@yahoo.ca> - 2011-06-25 14:44 -0700
        Re: joining tables and the order changes paul c <toledobythesea@yahoo.ca> - 2011-06-25 14:53 -0700
          Re: joining tables and the order changes Lee Fesperman <firstsql@gmail.com> - 2011-07-04 00:39 -0700

csiph-web