I am trying to write a complex query filtering data from a large table and I am having problems. I am going to work on this in baby steps so I can figure out how to do this correctly. Here is my first subquery.
OK the way I read this is sql statement is like this: The result set should show me each record listed for ABC Company and the Location of that company.
So If I had "ABC Company" listed in that table 13 times it should show me the 13 records and the CompLocation of each.
When I run just this I get a "At most one record can be returned by this subquery" error. Is my code wrong? This is my first attempt at a subquery.
Code:
SELECT [tbl_FINAL].CompName, [tbl_FINAL].CompLocation
FROM tbl_FINAL
WHERE (SELECT tbl_FINAL.CompName
FROM tbl_FINAL
WHERE tbl_FINAL.CompName="ABC COMPANY");
OK the way I read this is sql statement is like this: The result set should show me each record listed for ABC Company and the Location of that company.
So If I had "ABC Company" listed in that table 13 times it should show me the 13 records and the CompLocation of each.
When I run just this I get a "At most one record can be returned by this subquery" error. Is my code wrong? This is my first attempt at a subquery.