🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #11121

Re: INSERT INTO with SELECT

#11121
From: Martijn Tonies
Date: Fri, 13 Dec 2002 14:10
66 lines
2954 bytes
> Thank you for all your valuable input. I have been developing database
> application for years so I am not that newbie.
>
> Maybe I did not put my question very clear so everyone is confused with my
> intention. Let met put it this way:
>
> Let's say PROJECTS is a table created from an external file: abc.txt. While
> NEW_PROJECTS is a corresponding internal table. After some manipulation in
> the NEW_PROJECTS table, I want to export the changes made back to the
> PROJECTS table (and thus reflect the change in abc.txt). Then my concern to
> export the data in a certain order makes perfect sense.

If you're using the data in the external table in an ordered way OUTSIDE IB,
yes.

If you want it ordered INSIDE IB, simply use an ORDER BY clause.

As for the problem, I think the only way to get this ordered would be to select
from a stored procedure that has an ORDER BY clause in it's select ( I haven't
tried it though).


--

With regards,

Martijn Tonies
InterBase Workbench - the developer tool for InterBase & Firebird
Firebird Workbench - the developer tool for Firebird
Upscene Productions
http://www.upscene.com

"This is an object-oriented system.
If we change anything, the users object."

> Tks for any input.
>
> TR@SOE
>
>
> "TR@SOE" <tr@netease.com> д����Ϣ����:3df890a9@newsgroups.borland.com...
> > INSERT INTO PROJECTS
> > SELECT * FROM NEW_PROJECTS
> > WHERE NEW_PROJECTS.START_DATE > ��6-JUN-1994��;
> >
> > I know the above can work. But my question is:
> >
> > Can I add an "ORDER BY" to the SELECT? If yes, how? Something like:
> >
> > INSERT INTO PROJECTS
> > SELECT * FROM NEW_PROJECTS
> > ORDER BY ...
> >
> > doesn't work.
> >
> > If not, what to do if I want to insert into one table with some rows from
> > another dataset which is somehow sorted?
> >
> > Rgds!
> >
> > TR@SOE
> >
> >
>
>
Technical Details
Message-ID: <3df9e991$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!fr.usenet-edu.net!usenet-edu.net!proxad.net!proxad.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3df890a9@newsgroups.borland.com> <3df9d71a@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 114a0e,6bb88fb582a62a8a
X-Google-Attributes: gid114a0e,public
X-Google-ArrivalTime: 2002-12-13 06:10:04 PST
From: "Martijn Tonies" <m.tonies@upscene_remove.com>
Newsgroups: borland.public.interbase.sql
References: <3df890a9@newsgroups.borland.com> <3df9d71a@newsgroups.borland.com>
Subject: Re: INSERT INTO with SELECT
Date: Fri, 13 Dec 2002 15:10:09 +0100
Lines: 68
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 212.238.179.102
Message-ID: <3df9e991$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1039788433 212.238.179.102 (13 Dec 2002 06:07:13 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!fr.usenet-edu.net!usenet-edu.net!proxad.net!proxad.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail