troubleshooting Question

SQl query with join with out having to list all fields in main table.

Avatar of breeze351
breeze351 asked on
SQL
2 Comments1 Solution98 ViewsLast Modified:
I need to get all the fields from the main table and just a couple of fields from the 2nd table.
Can I do something like this:
SELECT
*
,pers.FNAME,
pers.LNAME,
pers.PHONE1
FROM
survey_data
Inner JOIN pers ON survey_data.TID = pers.TID and survey_data.PNID = pers.PNID

WHERE
survey_data.SEQ= 'NY1050000350' and survey_data.storekey='1001'

I need to do this on a couple of pages.  Some I don't need all the data from "survey_data" and on others I need all of it.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 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 2 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