Dantes Dantonovich
Dantes Dantonovich

Reputation: 1

How to use data from a table as a value for another command in SQL?

I have in mind something like this: Let's say there is a

Select Client_name
From Clients_Master_Table
where Client_Name = 'DS_Store';

So, here's how to use 'DS_Store' which is given from the table as a value for the command:

As if to do

Select DS_Store
From DS_Table;

Upvotes: 0

Views: 38

Answers (1)

jarlh
jarlh

Reputation: 44795

You probably want IN:

Select Client_name
From Clients_Master_Table
where Client_Name IN (Select DS_Store from DS_Table)

Upvotes: 0

Related Questions