i have two tables
User Table : Column Names - (pk)UserID, Username, Firstname, Lastname....
UserID | Username | FirstName | Lastname
1001 KiranReddy Kiran Reddy
1002 Arvind Arvind Kumar
1003 Arun Arrun Swamy
1004 Ramesh Ramesh Naidu
1005 Ramesh Ramesh Naidu
1006 Ajay1233 Ajay Sharma
Friend Table: Column Name - (fk)UserID1, (fk)UserID2, friendstatus,.....
UserID1 | UserID2
For Example : - I'm the UserID1 = '1001'
Here my requirement is i want to get those username whose UserID2 username start with 'A%'
i hope my question is clear
Select friend.UserID2 from User left join Friend on friend.userid1 = user.userid Where user.username like '%A' and friend.UserID1 ='1001'