Excel SQL Extract

400092

New Member
Joined
Dec 30, 2010
Messages
11
I am trying to extract data for specific list of identifers (around 30). How can I list them in sql query in where clause?
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
in a where clause and numeric using WHERE fieldname IN (123, 234, 345)
in a where clause and text using WHERE fieldname IN ('alpha', 'beta', 'gamma')

or if including the specific list is in a table, you can refer to the table & not list them individually in the WHERE clause
SELECT fields
FROM maintable M, filterlist F
WHERE M.commonfield = F.commonfield

Or without a WHERE clause using a join
SELECT fields
FROM maintable M INNER JOIN filterlist F ON m.commonfield = F.commonfield

HTH
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,329
Messages
6,124,302
Members
449,149
Latest member
mwdbActuary

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top