4
Answers

How to write query to retrieve from two linked tables

Joma Rajab

Joma Rajab

8y
263
1
I need to retrieve user Id from module Relation table based on the user type which is in user table and they have relationship 
Please how to write that query in sql data source tag
  1. <asp:SqlDataSource ID="SqlDataSource5" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"  
  2.    SelectCommand="SELECT distinct [Full_Name], [UniID] FROM [Users] WHERE [UniID]= (SELECT [UniID]from [ModuleRelation]) AND [user_type]='Staff'"></asp:SqlDataSource>  
Please help
thank you  

Answers (4)