Yes I can, but it is going to be cluttered because you didn't prefix your columns with table names.SELECT MAX(CASE WHEN propertyName = 'FirstName' THEN propertyValue END) AS FirstName, MAX(CASE WHEN propertyName = 'LastName' THEN propertyValue END) AS LastName, MAX(CASE WHEN propertyName = 'CompanyName' THEN propertyValue END) AS CompanyName, useridFROM ( SELECT PropertyName, PropertyValue, UserID FROM ProfilePropertyDefinition AS ppd INNER JOIN UserProfile AS up ON up.PropertyDefinitionID = ppd.PropertyDefinitionID ) AS dGROUP BY useridORDER BY userid
If you post the table definitions, the query will look cleaner.Peter LarssonHelsingborg, Sweden