Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
use temp1 select * from [TZraw].[dbo].[A1] where [TZraw].[dbo].[A1].[ID] in [select F1 from info1]
I am trying to select all the records from TZraw table A1 that match every record in temp1 table F1
select * from [TZraw].[dbo].[A1] where [TZraw].[dbo].[A1].[ID] in (select F1 as id from info1)
Use parenthesis:
select * from [TZraw].[dbo].[A1] where [TZraw].[dbo].[A1].[ID] in (select F1 from info1)
Instead of square brackets on the subselect.
Add a comment
Try round brackets for the subquery:
use temp1 select * from [TZraw].[dbo].[A1] where [TZraw].[dbo].[A1].[ID] in (select F1 from info1)
You need parenthesis for the IN clause
IN
try this in your query
... in (select F1 from info1)
Your SQL syntax is incorrect - the subquery should be in parens - (), not square braces [].
()
[]
Use a join instead of a subquery - SQL is better optimized for it:
SELECT first.* FROM [TZraw].[dbo].[A1] AS first INNER JOIN info1 AS second ON first.ID = second.F1
Try to create a temporary table
Select * From Tzrav ti Where .... ti...<>t...
REATE TEMPORARY TABLE SalesSummary ( Select* From Temp1 t Where .... )
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
select * from [TZraw].[dbo].[A1] where [TZraw].[dbo].[A1].[ID] in (select F1 as id from info1)