?
Solved

inner join of 4 table

Posted on 2011-09-20
1
Medium Priority
?
360 Views
Last Modified: 2012-05-12
I am trying to do innner join of 4 table and in my table there is only 2 record but I am doing something wrong in neer join it's repeating and getting total 4 record with saem repeating value.
please help me out with this.



      select  
       customer.Member_Status
      select customer.First_Name
      from      Link_Payment,Customer,Payment_Info,PersonalInfo,Customer_Subscription
       where customer.primarykey = PaymentInfo.UserID and
       customer.primarykey= PersonalInfo.UserID      and
      Link_Payment.SubscriptionID= Customer_Subscription.primaryKey and
        First_Name like 'john%'
0
Comment
Question by:Itgirl16
1 Comment
 
LVL 32

Accepted Solution

by:
Ephraim Wangoya earned 2000 total points
ID: 36571051
there is connection between Link_Payment and Customer_Subscription to rest of the tables
select customer.Member_Status, customer.First_Name 
from Customer      
inner join PersonalInfo on customer.primarykey = PersonalInfo.UserID
inner join PaymentInfo on customer.primarykey = PaymentInfo.UserID

--you have not defined these relationaships
inner join Link_Payment on customer.primarykey = Link_Payment.PrimaryKey
inner join Customer_Subscription on Link_Payment.SubscriptionID= Customer_Subscription.primaryKey 
--

where First_Name like 'john%'

Open in new window

0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question