Select Statement inside a Select Statement Input Tools
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I need to use a Select Statement inside a Select Statement.
Select * from Table1
where Id in (Select * from Table2)
Is this possible?
This would eliminate the need to get all Records from Table2 and then Join with Table1 and speed up my workflows.
Thanks! John!
- Labels:
- Input
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
just replace the 2nd * with ID
Select * from Table1
where Id in (Select ID from Table2)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
There is a long list of Ids, not just one. Now I have to get the Ids from 1 Input Tool, copy and paste them into a 2nd Input Tool. It takes way too much time to do that multiple times a day.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Can you give an example?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
select "Mitsubishi Electric Trane HVAC US LLC"."Mitsubishi Electric Trane HVAC US LLC".Order_Status__c.Id,
"Mitsubishi Electric Trane HVAC US LLC"."Mitsubishi Electric Trane HVAC US LLC".Order_Status__c.Distributor_PO_Number__c,
"Mitsubishi Electric Trane HVAC US LLC"."Mitsubishi Electric Trane HVAC US LLC".Order_Status__c.SAP_Order__c,
"Mitsubishi Electric Trane HVAC US LLC"."Mitsubishi Electric Trane HVAC US LLC".Order_Status__c.Customer_Reference_Number__c,
"Mitsubishi Electric Trane HVAC US LLC"."Mitsubishi Electric Trane HVAC US LLC".Order_Status__c.Account_Name__c
from "Mitsubishi Electric Trane HVAC US LLC"."Mitsubishi Electric Trane HVAC US LLC".Order_Status__c
where
"Mitsubishi Electric Trane HVAC US LLC"."Mitsubishi Electric Trane HVAC US LLC".Order_Status__c.Account_Name__c like 'Trane%'
and
"Mitsubishi Electric Trane HVAC US LLC"."Mitsubishi Electric Trane HVAC US LLC".Order_Status__c.SAP_Order__c in (select "Mitsubishi Electric Trane HVAC US LLC"."Mitsubishi Electric Trane HVAC US LLC"."Case".Id as CaseId,
"Mitsubishi Electric Trane HVAC US LLC"."Mitsubishi Electric Trane HVAC US LLC"."Case".IsClosed,
"Mitsubishi Electric Trane HVAC US LLC"."Mitsubishi Electric Trane HVAC US LLC"."Case".Order_Status_Number__c,
"Mitsubishi Electric Trane HVAC US LLC"."Mitsubishi Electric Trane HVAC US LLC"."Case".Customer_Reference_Number__c,
"Mitsubishi Electric Trane HVAC US LLC"."Mitsubishi Electric Trane HVAC US LLC"."Case".Record_Type_Name__c,
"Mitsubishi Electric Trane HVAC US LLC"."Mitsubishi Electric Trane HVAC US LLC"."Case".SAP_Order__c,
"Mitsubishi Electric Trane HVAC US LLC"."Mitsubishi Electric Trane HVAC US LLC"."Case".Distributor_Order_Number__c,
"Mitsubishi Electric Trane HVAC US LLC"."Mitsubishi Electric Trane HVAC US LLC"."Case".CreatedDate
from "Mitsubishi Electric Trane HVAC US LLC"."Mitsubishi Electric Trane HVAC US LLC"."Case"
where "Mitsubishi Electric Trane HVAC US LLC"."Mitsubishi Electric Trane HVAC US LLC"."Case".Order_Status_Number__c is NULL
and "Mitsubishi Electric Trane HVAC US LLC"."Mitsubishi Electric Trane HVAC US LLC"."Case".Record_Type_Name__c in ('Order Alternate Contact', 'Order Expedite Request', 'Order Inquiry', 'Order Inquiry (Closed)', 'Order Modification Request', 'RGA')
and
"Mitsubishi Electric Trane HVAC US LLC"."Mitsubishi Electric Trane HVAC US LLC"."Case".SAP_Order__c is NOT NULL)
