General SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesGeneral SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old October 23rd, 2003, 02:28 AM
gfrank gfrank is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 1 gfrank User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
combining rows from two fields plus non matches

Hi... I have tried all night to figure out how to create a query that will take two tables and result in rows which contain all of the data from both tables, but merge rows where a certain column in one table matches a certain column from the other.

As an example:

table one has 4 columns
id, descript, qty, code

there are four rows of data in it -- all different id numbers


Table two has 2 columns
id, qty

there are 2 rows of data in it -- one has the same id as an item in table one, the other has an id that is not in table one.

I want the result to be columns which contain all the column names from both tables -- 5 rows total... (the matching ids should merge into one row) and the places where there are no matches have empty columns where data was not found.

The best I have been able to do is get 4 rows where the one id match merged (Left Join) and the one row in table two which had an id that did not match table one did not get listed.

can anyone suggest a solution?

thanks

GF

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesGeneral SQL Development > combining rows from two fields plus non matches


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway