I am given a list in MS Excel of 554 statistical units (called Primary Sampling Units or PSUs) from another department and have to query all 554 PSUs from a SQL Server 2008 Spatial database table (PSUs_2012) that contains over 6000 PSUs.
I want to avoid having to type each of the 554 PSU numbers in the WHERE clause and is wondering if there is a way that I can write a query that takes values from a specified column (e.g. PSU_Number) in the Excel/CSV table and return all the rows with the same PSU numbers in the PSUs_2012 database table. I can also import the (excel/csv) data into the same database but would still have the same problem of how I should go about querying the main table (PSUs_2012) using all the values in a column of another table. Note that PSU numbers are unique IDs and are in both data sets with identical column names.
Please note that I am new to databases and programming but willing to learn, fast. Solutions using PostgreSQL and SpatiaLite are also welcome.