5
Reply

I fall in mistake Please help me my code not work correct

nofact noface

nofact noface

Jun 27 2015 6:47 AM
572

Hello every one

I fall in mistake

Please help me

I have 3 table

1 – User (id, email)

2 – Friend (sender, receiver, state)

3 – Post (sender, text, date)

Now

I want to select User (id), Post (*)

But

Select user’s post who is login and the other guy that receive a request for follow from the user and my code is:

Create PROCEDURE showpost

@email nvarchar (50)

AS

BEGIN

Select User.Code as code, post.* from post, friend, User where (User.email=post.sender) and ((friend.sender=@email or friend.reciver=@email) and state='ok' and (post.sender=friend.sender or post.sender=friend.reciver)) order by post.code desc

END

This is a problem

When show post the user’s post will be Repeated as many as his request for follow

Attached file is better

http://s6.uplod.ir/i/00629/4m2dkharb1oe.png
 

Answers (5)