473,398 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Three tables to one

EMW
Hi,

I have an Oracle database with different tables of data.
They all have one common field.
I need to combine some fields from three tables.
i.e.
field1 and field2 from table1
field3 and field4 from table2
field5 from table3

Alltogether I want to produce a dataset with one table with the following
schema: common, field1, field2, field3, field4, field5

How can I do this?
Can I do it by excecuting a SQL command to the database or do I combine the
data within the dataset or is there some other way of doing this?

My program is in VB.NET.

rg,
Eric
Nov 21 '05 #1
10 1203
The most efficient way, would be to do joins in your SQL query, so this is
all done at the database level.

"EMW" <so*****@MikroZoft.com> wrote in message
news:41**********************@dreader2.news.tiscal i.nl...
Hi,

I have an Oracle database with different tables of data.
They all have one common field.
I need to combine some fields from three tables.
i.e.
field1 and field2 from table1
field3 and field4 from table2
field5 from table3

Alltogether I want to produce a dataset with one table with the following
schema: common, field1, field2, field3, field4, field5

How can I do this?
Can I do it by excecuting a SQL command to the database or do I combine the data within the dataset or is there some other way of doing this?

My program is in VB.NET.

rg,
Eric

Nov 21 '05 #2
The most efficient way, would be to do joins in your SQL query, so this is
all done at the database level.

"EMW" <so*****@MikroZoft.com> wrote in message
news:41**********************@dreader2.news.tiscal i.nl...
Hi,

I have an Oracle database with different tables of data.
They all have one common field.
I need to combine some fields from three tables.
i.e.
field1 and field2 from table1
field3 and field4 from table2
field5 from table3

Alltogether I want to produce a dataset with one table with the following
schema: common, field1, field2, field3, field4, field5

How can I do this?
Can I do it by excecuting a SQL command to the database or do I combine the data within the dataset or is there some other way of doing this?

My program is in VB.NET.

rg,
Eric

Nov 21 '05 #3
To expand, you can use a view to format the data appropriately and then all
the client has to do is select information from the view.

"Marina" <so*****@nospam.com> wrote in message
news:#3**************@TK2MSFTNGP09.phx.gbl...
The most efficient way, would be to do joins in your SQL query, so this is
all done at the database level.

"EMW" <so*****@MikroZoft.com> wrote in message
news:41**********************@dreader2.news.tiscal i.nl...
Hi,

I have an Oracle database with different tables of data.
They all have one common field.
I need to combine some fields from three tables.
i.e.
field1 and field2 from table1
field3 and field4 from table2
field5 from table3

Alltogether I want to produce a dataset with one table with the following schema: common, field1, field2, field3, field4, field5

How can I do this?
Can I do it by excecuting a SQL command to the database or do I combine

the
data within the dataset or is there some other way of doing this?

My program is in VB.NET.

rg,
Eric


Nov 21 '05 #4
To expand, you can use a view to format the data appropriately and then all
the client has to do is select information from the view.

"Marina" <so*****@nospam.com> wrote in message
news:#3**************@TK2MSFTNGP09.phx.gbl...
The most efficient way, would be to do joins in your SQL query, so this is
all done at the database level.

"EMW" <so*****@MikroZoft.com> wrote in message
news:41**********************@dreader2.news.tiscal i.nl...
Hi,

I have an Oracle database with different tables of data.
They all have one common field.
I need to combine some fields from three tables.
i.e.
field1 and field2 from table1
field3 and field4 from table2
field5 from table3

Alltogether I want to produce a dataset with one table with the following schema: common, field1, field2, field3, field4, field5

How can I do this?
Can I do it by excecuting a SQL command to the database or do I combine

the
data within the dataset or is there some other way of doing this?

My program is in VB.NET.

rg,
Eric


Nov 21 '05 #5
I agree with Marina and Peter - doing this server side is most likely best.

However, in some situations doing a JOIN client side is required. If this
is the case in your client app, here is an artile on how to emulate a JOIN
with ADO.NET client side. The VB code version is in the comments to the
Blog post:

http://weblogs.sqlteam.com/davidm/ar...01/20/748.aspx
--
Mike

Mike McIntyre

"EMW" <so*****@MikroZoft.com> wrote in message
news:41**********************@dreader2.news.tiscal i.nl...
Hi,

I have an Oracle database with different tables of data.
They all have one common field.
I need to combine some fields from three tables.
i.e.
field1 and field2 from table1
field3 and field4 from table2
field5 from table3

Alltogether I want to produce a dataset with one table with the following
schema: common, field1, field2, field3, field4, field5

How can I do this?
Can I do it by excecuting a SQL command to the database or do I combine
the data within the dataset or is there some other way of doing this?

My program is in VB.NET.

rg,
Eric

Nov 21 '05 #6
I agree with Marina and Peter - doing this server side is most likely best.

However, in some situations doing a JOIN client side is required. If this
is the case in your client app, here is an artile on how to emulate a JOIN
with ADO.NET client side. The VB code version is in the comments to the
Blog post:

http://weblogs.sqlteam.com/davidm/ar...01/20/748.aspx
--
Mike

Mike McIntyre

"EMW" <so*****@MikroZoft.com> wrote in message
news:41**********************@dreader2.news.tiscal i.nl...
Hi,

I have an Oracle database with different tables of data.
They all have one common field.
I need to combine some fields from three tables.
i.e.
field1 and field2 from table1
field3 and field4 from table2
field5 from table3

Alltogether I want to produce a dataset with one table with the following
schema: common, field1, field2, field3, field4, field5

How can I do this?
Can I do it by excecuting a SQL command to the database or do I combine
the data within the dataset or is there some other way of doing this?

My program is in VB.NET.

rg,
Eric

Nov 21 '05 #7
EMW
could you give me an example?
I've searched for some examples on joining tables, but couldn't get it to
work.

rg,
Eric
"Marina" <so*****@nospam.com> schreef in bericht
news:%2****************@TK2MSFTNGP09.phx.gbl...
The most efficient way, would be to do joins in your SQL query, so this is
all done at the database level.

"EMW" <so*****@MikroZoft.com> wrote in message
news:41**********************@dreader2.news.tiscal i.nl...
Hi,

I have an Oracle database with different tables of data.
They all have one common field.
I need to combine some fields from three tables.
i.e.
field1 and field2 from table1
field3 and field4 from table2
field5 from table3

Alltogether I want to produce a dataset with one table with the following
schema: common, field1, field2, field3, field4, field5

How can I do this?
Can I do it by excecuting a SQL command to the database or do I combine

the
data within the dataset or is there some other way of doing this?

My program is in VB.NET.

rg,
Eric


Nov 21 '05 #8
EMW
could you give me an example?
I've searched for some examples on joining tables, but couldn't get it to
work.

rg,
Eric
"Marina" <so*****@nospam.com> schreef in bericht
news:%2****************@TK2MSFTNGP09.phx.gbl...
The most efficient way, would be to do joins in your SQL query, so this is
all done at the database level.

"EMW" <so*****@MikroZoft.com> wrote in message
news:41**********************@dreader2.news.tiscal i.nl...
Hi,

I have an Oracle database with different tables of data.
They all have one common field.
I need to combine some fields from three tables.
i.e.
field1 and field2 from table1
field3 and field4 from table2
field5 from table3

Alltogether I want to produce a dataset with one table with the following
schema: common, field1, field2, field3, field4, field5

How can I do this?
Can I do it by excecuting a SQL command to the database or do I combine

the
data within the dataset or is there some other way of doing this?

My program is in VB.NET.

rg,
Eric


Nov 21 '05 #9
"EMW" <so*****@MikroZoft.com> wrote:
could you give me an example?
I've searched for some examples on joining tables, but couldn't get it to
work.

rg,
Eric
Probably because you should have been looking for UNION
instead of JOIN, e.g.:

(
SELECT commonA, field1, field2,
'constA3', 'constA4', 'constA5'
FROM tableA WHERE ...
)UNION(
SELECT commonB, 'constB1', 'constB2',
field3, field4, 'constB5'
FROM tableB WHERE ...
)UNION(
SELECT commonC, 'constC1', 'constC2',
'constC3', 'constC4', field5
FROM tableC WHERE ...
);
you could use UNION ALL to preserve duplicates between
SELECTs - but I don't think that applies here.
Note that the column value's data types (or the "constant"
replacements) in each of the SELECT's column positions need
to be compatible.
"Marina" <so*****@nospam.com> schreef in bericht
news:%2****************@TK2MSFTNGP09.phx.gbl...
The most efficient way, would be to do joins in your SQL query, so this is
all done at the database level.

"EMW" <so*****@MikroZoft.com> wrote in message
news:41**********************@dreader2.news.tiscal i.nl...
Hi,

I have an Oracle database with different tables of data.
They all have one common field.
I need to combine some fields from three tables.
i.e.
field1 and field2 from table1
field3 and field4 from table2
field5 from table3

Alltogether I want to produce a dataset with one table with the following
schema: common, field1, field2, field3, field4, field5

How can I do this?
Can I do it by excecuting a SQL command to the database or do I combine

the
data within the dataset or is there some other way of doing this?

My program is in VB.NET.

rg,
Eric

'Any fool can write code that a computer can understand.
Good programmers write code that humans can understand.'
Martin Fowler,
'Refactoring: improving the design of existing code', p.15
Nov 21 '05 #10
I hate SQL so I always try too avoid it.

However being active in these newsgroups is every time learning more of it.

Eric, when this works, will you than answer that here, this can be a great
addition.

Cor
Nov 21 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Emilio | last post by:
Hello everyone. I hope someone can help me with this. I have 3 columns called EMPLOYEE_TEST, TEST_QA and EMPLOYEE_TEST_ANSWER. The TEST_QA table contains the following: TEST_QA_ID |...
1
by: NA | last post by:
Is it possible to have adjustable tables (not Access tables per se) but those in Ms Word or Excel based on nexted forms three deep? In other words, if I have a main form, Repair History, both the...
0
by: WindAndWaves | last post by:
Hi Gurus Here is another question that I have been struggling with for over a year. Basically, I would like to allow users to enter data into three tables in at the same time. The reason it...
7
by: RLN | last post by:
Re: Access 2000 I have three history tables. Each table contains 3 years worth of data. All three tables have a date field in them (and autonum field). Each table has the potential to contain...
11
by: MP | last post by:
context: (vb6 / ado / .mdb / jet4.0 / not using access) hypothetical problem say I need to track the properties of boxes. There are three kinds, cardboard, wood, and sheet metal. Each box...
3
by: BrianDH | last post by:
Hi I have a form with multi-tabs, and on each tab I have a one combo that has the same values. I populate all 3 combo with the same one datacall/dataset My problem is: when I make a value...
6
by: John | last post by:
Hi I have three tables with a common id with which they can be linked. I need to merge them in a way that the resultant table has all records from three tables. Below is what sort of result I am...
7
by: cov | last post by:
I have a php query where I'm attempting to pull data from 3 different tables between a php form and mysql db. I had hoped early on to use a unique identifier to help ensure referential integrity...
2
by: einsson | last post by:
I face a problem, please help. Error I hit when there are three combobox. Please refer the code with italic characters. this.comboBox1.DataSource = this.dataSet11.Tables;...
1
by: doc1355 | last post by:
I have a feeling that this is an easy question. However I'm a newbee and don't have any idea how to do this. I have three tables that stores my users information. Each user has a unique ID that is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.