troubleshooting Question

Sql Join Statement

Avatar of Millkind
MillkindFlag for Afghanistan asked on
Microsoft SQL Server 2008SQL
9 Comments1 Solution343 ViewsLast Modified:
I want to combine the two select statements and use the output to insert into another table.
The following are all three individually.


select tblStudent.dIDNumber,tblStudent.lLostCardIdentifier from tblStudent where tblStudent.lMealPlan between 200 and 297 or tblStudent.dIDNumber in (16734300,43384500)

select tblEvents.achEventName,tblEvents.achRemoveDate,bGeneralAccess,tblEvents.lEventNumber from tblEvents where tblEvents.lEventNumber = 601

insert into tblStudentEvents (dIDNumber,lLostCardIdentifier,lEventNumber,lTickets,achEventName,achRemoveDate,bGeneralAccess)
values (tblstudent.dIDNumber,tblstudent.lLostCardIdentifier,tblevents.lEventNumber,1,tblevents.achEventName,tblevents.achEventName,tblevents.bGeneralAccess)
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 9 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros