Tuesday, 27 August 2013

How to "filter" duplicate item in select statement

How to "filter" duplicate item in select statement

I have 2 tables : "Hotels" and "Area".
"Hotels" table has the following columns: INDEX, NAME, AREA (1,'hotel
bla", 4)
"Area" tbale has the following columns: INDEX, NAME, CODE
(4,'TEL-AVIV','TLV')
this means the "hotel bla" is in tel aviv
i need to create a list of hotels that have the same name and area
("duplicate hotels") for examaple: Hotels has 3 recoreds:
1,'hotel a',1
2,'hotel a',1
3,'hotel b',2
4,'hotel b',2
Area has 2 records
1,'tel-aviv','TLV'
2,'haifa','HAF'
the output should be something like: 'hotel a','1' 'hotel b,'2'
thank you all!

No comments:

Post a Comment