hi,
I have table
CREATE TABLE supportContacts
(
id int auto_increment primary key,
type varchar(20),
details varchar(30),
code_id int
);
INSERT INTO supportContacts
(type, details,code_id)
VALUES
('Email0', '0admin@sqlfiddle.com',1033),
('Email1', '1admin@sqlfiddle.com',1031),
('Email2', '2admin@sqlfiddle.com',1033),
('Email3', '3admin@sqlfiddle.com',1031),
('Email5', '5admin@sqlfiddle.com',1032),
('Email6', '6admin@sqlfiddle.com',1032),
('Twitter4', '4@sqlfiddle',1033);
when i ran this query
Select type from supportContacts where code_id=1033
union
(
Select type from supportContacts where code_id
not in (Select type from supportContacts where code_id=1033)
)
output is
TYPE
Email0
Email2
Twitter4
Email1
Email3
Email5
Email6
I want to replace this query with join's how can i do that.
Thanks