Re: How to do certain task in SQL?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Richard Fagen (no_spam_at_my_isp.com)
Date: 01/18/05


Date: Mon, 17 Jan 2005 21:11:18 -0500

Hi Jim,

I'm not taking it personally, I appreciate you comments :)

I had a feeling that I'd have to use the "select" command to filter the
record(s) that I want to work with and then to think in terms of 'a set
of records'.

I have already defined primary keys for my imported DBF files. I know
how to 'update' information in existing records, but I was browsing the
'SQL Book Online' and couldn't find any references on how to combine
records from multiple tables. I know about the 'join' command, but my
request is a bit different. Say I had a existing table with 1000
records and I had the user input information into a similar table with
15 new records (exact same layout) and I wanted to merge the two tables
into one table with 1015 records, how would I do this?

Thanks for the recommendation, I'll check it out. Is it a general book
or one specific to MS SQL?

Richard

Jim Young wrote:
> Hi Richard,
>
> Don't take this personally, but from the questions you are asking, you have
> a bit of a learning curve ahead of you. First you need to stop looking at
> SQL data as a list of sequential records. SQL data is retrieved and
> manipulated as sets of data. There really is no equivalent to "move to last
> record" or first record. If you need to update or select a particular record
> then you need to define your records with either a primary key or some other
> unique contraint on the data and provide the SQL statement that will extract
> a distinct record. I suggest that you find a good general book on SQL and
> study up on relational database theory. As a recommendation "Data &
> Databases: Concepts In Practice" by Joe Celko is a very good book that lays
> down the basics of relational database design.
>
> Jim


Quantcast