Source language: Translate to:

Combine fields from many tables into a new table

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Combine fields from many tables into a new table

Postby donmichel » Fri Apr 29, 2011 10:40 am

How do I combine similar fields from three tables and insert the combined data into a new table? In three different tables I have among other fields PURPOSE, NAME, and CALCULAT fields. I want these three fields in the different tables combined and put into another table which has only the three fields. Please help me.
donmichel
 
Posts: 38
Joined: Sun Sep 14, 2008 1:25 am

Postby Fabien » Fri Apr 29, 2011 11:26 am

Hi,

For display three fields from different table
Example:
FIELD1--> TABLE1
FIELD2--> TABLE2
FIELD3--> TABLE3

Code: Select all
dbpOpenTable "BASE" "TABLE1" ""
dbpOpenTable "BASE" "TABLE2" ""
dbpOpenTable "BASE" "TABLE3" ""
dbpShowGrid "BASE" "TABLE1" "Rectangle1"
dbpExecSQL "BASE" "SELECT a.FIELD1, b.FIELD2, c.FIELD3 FROM TABLE1 a, TABLE2 b, TABLE3 c;" ""

Fabien
¡ sǝıʇɹo sǝl suɐp éɯéɯ sɐd ǝssnod
User avatar
Fabien
 
Posts: 137
Joined: Thu Dec 04, 2008 2:31 pm
Location: France - Lyon

Postby donmichel » Fri Apr 29, 2011 11:40 am

Thanks Fabian,

But that doesn't seem to solve my issue. Any direct way without using sql? I am not much aware of sql codes.
donmichel
 
Posts: 38
Joined: Sun Sep 14, 2008 1:25 am

Postby dpayer » Sat Apr 30, 2011 6:28 am

donmichel wrote:Thanks Fabian,

But that doesn't seem to solve my issue. Any direct way without using sql? I am not much aware of sql codes.


You will find that SQL 'codes' are your friend :)

Here is a good tutorial to do what you want:

http://www.w3schools.com/sql/sql_join.asp

Let us know how it works for you.

David P.
User avatar
dpayer
 
Posts: 1380
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Postby donmichel » Sat Apr 30, 2011 12:54 pm

Thanks a lot for the suggestion. SQL works really wonderful. Thanks all
donmichel
 
Posts: 38
Joined: Sun Sep 14, 2008 1:25 am


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 2 guests