dbTalk Databases Forums  

Mutiple Tables into one (Query)

microsoft.public.sqlserver.misc microsoft.public.sqlserver.misc


Discuss Mutiple Tables into one (Query) in the microsoft.public.sqlserver.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
georgiairish@gmail.com
 
Posts: n/a

Default Mutiple Tables into one (Query) - 11-14-2007 , 07:08 PM






I have inherited a SQL db and am trying to get some data from it. The
issue I am having is that the data is broken down by year in tables
(data2000, data2001, data2003, ...). None of these tables had a key
that was able to relate them to each other. I created a key by
combining a division number and department number. The only problem is
that each year they added and subtracted departments, and changed the
department name (misspelled, abbreviated).

I need to create a table that has the latest department/division name
in one place (having pulled from 2006 to 2000 and filling in where
possible). How?

This is my first foray into the SQL world, and I appreciate any help
you can give me.

JPM

Reply With Quote
  #2  
Old   
Jack Vamvas
 
Posts: n/a

Default Re: Mutiple Tables into one (Query) - 01-25-2008 , 08:03 AM






If you have a situation that the dept names keep getting changed etc , and
these were not kept in a normalized fashion , then
you will have to do a clean up operation.
I recommend , that you create a master list of all the departments , and
most if not all of the variations you encounter .
At that point you can create a table that holds that dept names , which then
enables you tom create the Foreighn Keys for depts.



--

Jack Vamvas
___________________________________
Search IT jobs from multiple sources- http://www.ITjobfeed.com




<georgiairish (AT) gmail (DOT) com> wrote

Quote:
I have inherited a SQL db and am trying to get some data from it. The
issue I am having is that the data is broken down by year in tables
(data2000, data2001, data2003, ...). None of these tables had a key
that was able to relate them to each other. I created a key by
combining a division number and department number. The only problem is
that each year they added and subtracted departments, and changed the
department name (misspelled, abbreviated).

I need to create a table that has the latest department/division name
in one place (having pulled from 2006 to 2000 and filling in where
possible). How?

This is my first foray into the SQL world, and I appreciate any help
you can give me.

JPM



Reply With Quote
  #3  
Old   
Jack Vamvas
 
Posts: n/a

Default Re: Mutiple Tables into one (Query) - 01-25-2008 , 08:03 AM



If you have a situation that the dept names keep getting changed etc , and
these were not kept in a normalized fashion , then
you will have to do a clean up operation.
I recommend , that you create a master list of all the departments , and
most if not all of the variations you encounter .
At that point you can create a table that holds that dept names , which then
enables you tom create the Foreighn Keys for depts.



--

Jack Vamvas
___________________________________
Search IT jobs from multiple sources- http://www.ITjobfeed.com




<georgiairish (AT) gmail (DOT) com> wrote

Quote:
I have inherited a SQL db and am trying to get some data from it. The
issue I am having is that the data is broken down by year in tables
(data2000, data2001, data2003, ...). None of these tables had a key
that was able to relate them to each other. I created a key by
combining a division number and department number. The only problem is
that each year they added and subtracted departments, and changed the
department name (misspelled, abbreviated).

I need to create a table that has the latest department/division name
in one place (having pulled from 2006 to 2000 and filling in where
possible). How?

This is my first foray into the SQL world, and I appreciate any help
you can give me.

JPM



Reply With Quote
  #4  
Old   
Jack Vamvas
 
Posts: n/a

Default Re: Mutiple Tables into one (Query) - 01-25-2008 , 08:03 AM



If you have a situation that the dept names keep getting changed etc , and
these were not kept in a normalized fashion , then
you will have to do a clean up operation.
I recommend , that you create a master list of all the departments , and
most if not all of the variations you encounter .
At that point you can create a table that holds that dept names , which then
enables you tom create the Foreighn Keys for depts.



--

Jack Vamvas
___________________________________
Search IT jobs from multiple sources- http://www.ITjobfeed.com




<georgiairish (AT) gmail (DOT) com> wrote

Quote:
I have inherited a SQL db and am trying to get some data from it. The
issue I am having is that the data is broken down by year in tables
(data2000, data2001, data2003, ...). None of these tables had a key
that was able to relate them to each other. I created a key by
combining a division number and department number. The only problem is
that each year they added and subtracted departments, and changed the
department name (misspelled, abbreviated).

I need to create a table that has the latest department/division name
in one place (having pulled from 2006 to 2000 and filling in where
possible). How?

This is my first foray into the SQL world, and I appreciate any help
you can give me.

JPM



Reply With Quote
  #5  
Old   
Jack Vamvas
 
Posts: n/a

Default Re: Mutiple Tables into one (Query) - 01-25-2008 , 08:03 AM



If you have a situation that the dept names keep getting changed etc , and
these were not kept in a normalized fashion , then
you will have to do a clean up operation.
I recommend , that you create a master list of all the departments , and
most if not all of the variations you encounter .
At that point you can create a table that holds that dept names , which then
enables you tom create the Foreighn Keys for depts.



--

Jack Vamvas
___________________________________
Search IT jobs from multiple sources- http://www.ITjobfeed.com




<georgiairish (AT) gmail (DOT) com> wrote

Quote:
I have inherited a SQL db and am trying to get some data from it. The
issue I am having is that the data is broken down by year in tables
(data2000, data2001, data2003, ...). None of these tables had a key
that was able to relate them to each other. I created a key by
combining a division number and department number. The only problem is
that each year they added and subtracted departments, and changed the
department name (misspelled, abbreviated).

I need to create a table that has the latest department/division name
in one place (having pulled from 2006 to 2000 and filling in where
possible). How?

This is my first foray into the SQL world, and I appreciate any help
you can give me.

JPM



Reply With Quote
  #6  
Old   
Jack Vamvas
 
Posts: n/a

Default Re: Mutiple Tables into one (Query) - 01-25-2008 , 08:03 AM



If you have a situation that the dept names keep getting changed etc , and
these were not kept in a normalized fashion , then
you will have to do a clean up operation.
I recommend , that you create a master list of all the departments , and
most if not all of the variations you encounter .
At that point you can create a table that holds that dept names , which then
enables you tom create the Foreighn Keys for depts.



--

Jack Vamvas
___________________________________
Search IT jobs from multiple sources- http://www.ITjobfeed.com




<georgiairish (AT) gmail (DOT) com> wrote

Quote:
I have inherited a SQL db and am trying to get some data from it. The
issue I am having is that the data is broken down by year in tables
(data2000, data2001, data2003, ...). None of these tables had a key
that was able to relate them to each other. I created a key by
combining a division number and department number. The only problem is
that each year they added and subtracted departments, and changed the
department name (misspelled, abbreviated).

I need to create a table that has the latest department/division name
in one place (having pulled from 2006 to 2000 and filling in where
possible). How?

This is my first foray into the SQL world, and I appreciate any help
you can give me.

JPM



Reply With Quote
  #7  
Old   
Jack Vamvas
 
Posts: n/a

Default Re: Mutiple Tables into one (Query) - 01-25-2008 , 08:03 AM



If you have a situation that the dept names keep getting changed etc , and
these were not kept in a normalized fashion , then
you will have to do a clean up operation.
I recommend , that you create a master list of all the departments , and
most if not all of the variations you encounter .
At that point you can create a table that holds that dept names , which then
enables you tom create the Foreighn Keys for depts.



--

Jack Vamvas
___________________________________
Search IT jobs from multiple sources- http://www.ITjobfeed.com




<georgiairish (AT) gmail (DOT) com> wrote

Quote:
I have inherited a SQL db and am trying to get some data from it. The
issue I am having is that the data is broken down by year in tables
(data2000, data2001, data2003, ...). None of these tables had a key
that was able to relate them to each other. I created a key by
combining a division number and department number. The only problem is
that each year they added and subtracted departments, and changed the
department name (misspelled, abbreviated).

I need to create a table that has the latest department/division name
in one place (having pulled from 2006 to 2000 and filling in where
possible). How?

This is my first foray into the SQL world, and I appreciate any help
you can give me.

JPM



Reply With Quote
  #8  
Old   
Jack Vamvas
 
Posts: n/a

Default Re: Mutiple Tables into one (Query) - 01-25-2008 , 08:03 AM



If you have a situation that the dept names keep getting changed etc , and
these were not kept in a normalized fashion , then
you will have to do a clean up operation.
I recommend , that you create a master list of all the departments , and
most if not all of the variations you encounter .
At that point you can create a table that holds that dept names , which then
enables you tom create the Foreighn Keys for depts.



--

Jack Vamvas
___________________________________
Search IT jobs from multiple sources- http://www.ITjobfeed.com




<georgiairish (AT) gmail (DOT) com> wrote

Quote:
I have inherited a SQL db and am trying to get some data from it. The
issue I am having is that the data is broken down by year in tables
(data2000, data2001, data2003, ...). None of these tables had a key
that was able to relate them to each other. I created a key by
combining a division number and department number. The only problem is
that each year they added and subtracted departments, and changed the
department name (misspelled, abbreviated).

I need to create a table that has the latest department/division name
in one place (having pulled from 2006 to 2000 and filling in where
possible). How?

This is my first foray into the SQL world, and I appreciate any help
you can give me.

JPM



Reply With Quote
  #9  
Old   
Jack Vamvas
 
Posts: n/a

Default Re: Mutiple Tables into one (Query) - 01-25-2008 , 08:03 AM



If you have a situation that the dept names keep getting changed etc , and
these were not kept in a normalized fashion , then
you will have to do a clean up operation.
I recommend , that you create a master list of all the departments , and
most if not all of the variations you encounter .
At that point you can create a table that holds that dept names , which then
enables you tom create the Foreighn Keys for depts.



--

Jack Vamvas
___________________________________
Search IT jobs from multiple sources- http://www.ITjobfeed.com




<georgiairish (AT) gmail (DOT) com> wrote

Quote:
I have inherited a SQL db and am trying to get some data from it. The
issue I am having is that the data is broken down by year in tables
(data2000, data2001, data2003, ...). None of these tables had a key
that was able to relate them to each other. I created a key by
combining a division number and department number. The only problem is
that each year they added and subtracted departments, and changed the
department name (misspelled, abbreviated).

I need to create a table that has the latest department/division name
in one place (having pulled from 2006 to 2000 and filling in where
possible). How?

This is my first foray into the SQL world, and I appreciate any help
you can give me.

JPM



Reply With Quote
  #10  
Old   
Jack Vamvas
 
Posts: n/a

Default Re: Mutiple Tables into one (Query) - 01-25-2008 , 08:03 AM



If you have a situation that the dept names keep getting changed etc , and
these were not kept in a normalized fashion , then
you will have to do a clean up operation.
I recommend , that you create a master list of all the departments , and
most if not all of the variations you encounter .
At that point you can create a table that holds that dept names , which then
enables you tom create the Foreighn Keys for depts.



--

Jack Vamvas
___________________________________
Search IT jobs from multiple sources- http://www.ITjobfeed.com




<georgiairish (AT) gmail (DOT) com> wrote

Quote:
I have inherited a SQL db and am trying to get some data from it. The
issue I am having is that the data is broken down by year in tables
(data2000, data2001, data2003, ...). None of these tables had a key
that was able to relate them to each other. I created a key by
combining a division number and department number. The only problem is
that each year they added and subtracted departments, and changed the
department name (misspelled, abbreviated).

I need to create a table that has the latest department/division name
in one place (having pulled from 2006 to 2000 and filling in where
possible). How?

This is my first foray into the SQL world, and I appreciate any help
you can give me.

JPM



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.