Skip to content
Advertisement

Getting the personal contact details of an employee

I want to get the Email, Phone and Mobile number of each employee.

The ContactDetailsType contains the Label which is email,phone,fax… and ContactDetails contains the ContactDetailsTypeId (the ID of ContactDetailsType) and the Info having the value of the phone number (for example).

I tried the following query to get the phone but I’m getting the following error :

Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

Advertisement

Answer

Right now your subquery is bringing all contact details, you need a correlated query so is filter by the outside query. also be carefull because you are using the same alias inside and out.

This may work, but again without data structure is just a guess. Hope at least give you the idea of what you should do.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement