i am trying mutual friend but query not work error show
Invalid column name 'id'.
pls check sql query .
i have create two table in sql userinfo and tblfrequest.
create table tbluserinfo(id int identity(1,1),First_Name varchar(100),Last_Name varchar(100), EMAIL VARCHAR(40),Pwd varchar(100),Gender varchar(10),mob_no varchar(40),D_O_B VARCHAR(30),IP_ADDRESS VARCHAR(30),ACCOUNT_DATE VARCHAR(20),U_STATUS VARCHAR(5),email_code VARCHAR(100))
create table tblfrequst(f_id int identity(1,1),to_id int, from_id int,date varchar(100),date_time varchar(50),rqaccepted_time varchar(50),rqaccepted_date varchar(20),request_status VARCHAR(10))
SELECT DISTINCT F1.*, F2.from_id AS MutualFriend
FROM tblfrequst AS F1
INNER JOIN tblfrequst AS F2 ON F2.from_id <> F1.from_id AND F2.to_id = F1.to_id
INNER JOIN tbluserinfo AS P1 ON P1.ID = F1.from_id
INNER JOIN tbluserinfo AS P2 ON P2.ID = F2.from_id
JOIN tbluserinfo AS P3 ON P3.ID = F2.from_id
WHERE F1.id = 5