Depending of this users
table structure :
CREATE TABLE users
AS
SELECT id,name,email1,email2
FROM ( VALUES
( 1, 'John', '[email protected]', '[email protected]' ),
( 2, 'Baz' , '[email protected]' , null )
) AS t(id,name,email1,email2);
Is it possible to have this output with one query ?
John | [email protected]
John | [email protected]
Baz | [email protected]
email
andemail2
are provided ?