Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> SQL guestion finding duplicates

SQL guestion finding duplicates

From: Adam Sandler <corn29_at_excite.com>
Date: 11 Jul 2005 07:38:34 -0700
Message-ID: <1121092714.729379.239250@g47g2000cwa.googlegroups.com>


Hello,

I have a SQL question. Consider the following table...



| Employee |


| Name | Birthdate |


| Joe | 1 July |
| Sue | 10 Aug |
| Mark | 15 Sep |
| Jane | 10 Aug |

I'd like to find out all the employees who share the same birthday. I was thinking initially that if I used SQL HAVING that would work... but then I thought (from what I understand about the command) HAVING only works on arithmetic operators. Also if I set up a condition with WHERE, wouldn't that imply some previous knowledge of the birthdays?

My development background screams doing some kind of string compare or regular expression matching but that could either get complicated or perform poorly if the employee table had thousands of rows.

At any rate, how could I write a SQL statement to return all the names (and birthdates) of employees with identical birthdays?

Thanks!!! Received on Mon Jul 11 2005 - 09:38:34 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US