473,403 Members | 2,359 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,403 software developers and data experts.

How can i merge three table?

Hello, i'm looking for a great sql query....look this:
i have this tree tables:

Expand|Select|Wrap|Line Numbers
  1. TA
  2. barcode   qnt
  3. 1          2
  4. 2          3
  5. 3          1
  6.  
  7.  
  8.  
  9. TB
  10. barcode   qnt
  11. 1          2
  12. 2          2
  13. 4          1
  14.  
  15.  
  16. TC
  17. barcode  desc 
  18. 1            abc   
  19. 2            def
  20. 3            ghi
  21. 4            lmn
  22.  
i need a result like this...do you think it's possible with only one query?

Expand|Select|Wrap|Line Numbers
  1. desc  barcode  qntA  qntB
  2. abc    1        2      2
  3. def    2        3      2 
  4. ghi    3        1      -
  5. lmn    4        -      1
  6.  
Jun 29 '07 #1
2 1305
Motoma
3,237 Expert 2GB
It certainly is possible to do this with one query. Have you tried anything yet? Post what you have done so far, and I will help you through the rest.
Jun 29 '07 #2
ck9663
2,878 Expert 2GB
try this one:


select tc.desc, tc.barcode, ta.qnt as qntA, tb.qnt as qntB
from tc
left join ta on tc.barcode = ta.barcode
left join tb on tc.barcode = tb.barcode
Jun 29 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: jaykchan | last post by:
One of the table that is in a merge replication somehow is missing an index. Strangely, only the table in one of the subscriber of the merge replication is missing the index; another subscriber and...
3
by: Steve | last post by:
I have a people table of about 25 fields. The table is initially created each year from 5 different sources. The records from each source are appended to the people table. Any person may be in one...
8
by: Squirrel | last post by:
Hi everyone, I've created a mail merge Word doc. (using Office XP) , the data source is an Access query. Functionality I'm attempting to set up is: User sets a boolean field to true for...
3
by: Andy Davis | last post by:
I have set up a mail merge document in Word 2003 which gets its data from my Access 2000 database. I want to set up a button on a form that: 1. runs the query to provide the dat for the merge...
1
by: EoRaptor013 | last post by:
We have a situation almost exactly like that in the MS documentation vis a vis peer-to-peer replication. We have three servers and three user groups, one each in Chicago, New York, and Bermuda....
16
by: UDBDBA | last post by:
Hi All: I need some clarification on a MERGE statement. The database is on V8 FP12 (AIX) 64bit. The source table is tableA. The target is a View "FACT" with UNION ALL because of the 512 Gig...
2
by: JK | last post by:
I saw Danny Lesandrini's article on Database Journal (http://www.databasejournal.com/features/msaccess/article.php/2236471) on how to merge tables from identical databases. This is exactly what...
16
by: Sam Durai | last post by:
Hello, I need to merge a small table (of rows less than 100,sometimes even 0 rows) to a big table (of rows around 4 billion). I used the PK of the big table as merge key but merge does a table scan...
1
by: barny | last post by:
Hi all, I have been trying to merge two access tables together all morning with no succsess. In table one I have Account Number|Return1|Return2|Return3| M1234567 | P9832 | Q1234 | P4322 |...
4
by: coolhand729 | last post by:
Okay, this is not your normal two table query (at least it doesn't seem that way to me). I'm using Access 2000 on Windows XP. I have two tables in access. One is a table with addresses of club...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.