I want to limit the results from one table on the 'Firm_Key' value. I also want to use the same limitation on several other tables, but which do not have the column 'Firm_Key'. The tables do share an 'Account_Index' column. All my attempts give errors. Thank you for your help.
SQL SELECT * FROM Table1 WHERE Firm_Key='myFilterValue';
SQL SELECT * FROM Table2 as A INNER JOIN tblFiltered as B ON A.Account_Index = B.Account_Index;
Thanks, - the query seems to take longer than it should seems to be retrieving everything in Table2 for each item in tblFiltered. How do I retrieve only the values from Table2 that have an Account_Index value found in tblFiltered? When I write:
SQL SELECT * from Table2 as A WHERE A.Account_Index = tblFiltered.Account_Index;
I get an error for trying to use 'tblFiltered'.
My basic problem is I don't understand when and how I can use that table name of tblFiltered.
Also - yes, how would you script it for separate tables? I have a Table3, and a Table4 that I also want only to bring in rows where a matching Account_Index value appears in my tblFiltered version of Table1.
Thanks - that was suggested earlier, but there are too many results. My tblFiltered only has 50 results, and the other table is returning thousands, but I only want the 50 that also appear in tblFiltered. Their common field is 'Account_Index'. This works superfast and easy in SQL Studio. I don't get what the problem is here.