Link to home
Start Free TrialLog in
Avatar of G0ggy
G0ggyFlag for United Kingdom of Great Britain and Northern Ireland

asked on

SQL query syntax

Can I get some help with creating this query.

I have one table which has the following columns I am interested in:

dbo.UserProfileValue
RecordID (FK, bigint, not null)
PropertyID (big int, not null)
PropertyVal (sql_variant, null)

And another table with the next columns I want:
dbo.UserProfile_Full
RecordID (PK, not null)
NTName (nvarchar(400), not null)

Each user will have one entry in the UserProfile_Full table, but can, and usually will, have multiple values in the UserProfileValue table.

So, for example, my entry in the UserProfile_Full table would be:
2217 darrylg

And the matching records in the UserProfileValue would be:
2217 10002 Consumer
2217 10007 darrylg@corgi.com

I want to return the data in the following style:
2217 darrylg Consumer darrylg@corgi.com

I cannot remember the SQL syntax to produce these results, can you help?
ASKER CERTIFIED SOLUTION
Avatar of TimCottee
TimCottee
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial