SELECT * FROM Status_Post INNER JOIN Frend_List ON Status_Post.UserId = Frend_List.New_Id WHERE Frend_List.List_Of =27 OR Status_Post.UserId =27
This is a clause I am trying to reach data with. But this gives me exact data only for the Frend_List.List_Of while looking for Status_Post.UserId =27 It gives back every data multiply by 2.
Like If there is a value for it it will send it twice. Any error in this clause?
Please "Marks As Answer" if any answer helped you out!
~~! FIREWALL !~~
Afzaal.Ahmad...
Contributor
2759 Points
1060 Posts
INNER JOIN giving two values
Nov 25, 2012 07:18 AM|LINK
This is a clause I am trying to reach data with. But this gives me exact data only for the Frend_List.List_Of while looking for Status_Post.UserId =27 It gives back every data multiply by 2.
Like If there is a value for it it will send it twice. Any error in this clause?
~~! FIREWALL !~~
urenjoy
Star
13521 Points
2035 Posts
Re: INNER JOIN giving two values
Nov 25, 2012 09:25 AM|LINK
Make sure, you have one to one relationship(UserId and New_Id) in Frend_List and Status_Post.
if you are getting duplicate records, you can use Distinct in select statement.
Afzaal.Ahmad...
Contributor
2759 Points
1060 Posts
Re: INNER JOIN giving two values
Nov 25, 2012 11:58 AM|LINK
Yes they are same in the database tables.
Also the Frend_List.List_Of and Status_Post.UserId are same. But I am trying to get two different types of data.
One while joining the frend_list and other by just getting the value of currentUser.
~~! FIREWALL !~~