Arnie Rowland
You have a table that has not been 'normalized', and as you can easily determine, it will often be difficult to work with. You would be far better off to have only one Telephone number column -adding as many rows per individual as needed.
For the purposes of your 'exam', here is one suggested solution:
SET NOCOUNT ON
DECLARE @MyTable table
( RowID int IDENTITY,
[Name] varchar(20),
Telephone1 varchar(20),
Telephone2 varchar(20)
)
INSERT INTO @MyTable VALUES ( 'ian', '1234567', '7654321' )
INSERT INTO @MyTable VALUES ( 'Sean', '1111111', '2222222' )
SELECT
[Name],
Telephone = Telephone1
FROM @MyTable
UNION
SELECT
[Name],
Telephone2
FROM @MyTable
Name Telephone
-------------------- --------------------
ian 1234567
ian 7654321
Sean 1111111
Sean 2222222