Solved

SQL: Create Table

Posted on 2011-03-01
2
275 Views
Last Modified: 2012-05-11
Need to LEFT OUTER JOIN to an imaginary table that I need to create on the fly...kind of like an array.

I attached an Excel sheet of what I need to LEFT OUTER JOIN to.

SELECT R.DisplayName, E.Entered
FROM Resources R LEFT OUTER JOIN ( EXCEL SHEET ) E ON E.RsrcNo = R.RsrcNo
Book1.xlsx
0
Comment
Question by:InfoTechEE
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 250 total points
ID: 35013651
0
 
LVL 32

Accepted Solution

by:
Ephraim Wangoya earned 250 total points
ID: 35013653
Use a temp table
declare @Table1 Table(RsrcNo int, DisplayName varchar(20), Entered datetime)

insert into @Table1
select 1743, 'User 1', '6/6/2006'
union all
select 4986, 'User 2', '5/4/2010'
union all
select 1672, 'User 3', '8/18/2006'
union all
select 5100, 'User 4', '3/1/2011'
union all
select 1821, 'User 5', '6/8/2005'
union all
select 4214, 'User 6', '9/25/2006'
union all
select 3623, 'User 7', '4/19/2006'
union all
select 4089, 'User 8', '8/18/2006'

SELECT R.DisplayName, E.Entered
FROM Resources R 
LEFT OUTER JOIN @Table1 E ON E.RsrcNo = R.RsrcNo

Open in new window

0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question