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 -> Re: SQL guestion finding duplicates

Re: SQL guestion finding duplicates

From: IANAL_VISTA <IANAL_Vista_at_hotmail.com>
Date: Mon, 11 Jul 2005 14:45:45 GMT
Message-ID: <Xns96904EF866815SunnySD@68.6.19.6>


"Adam Sandler" <corn29_at_excite.com> wrote in news:1121092714.729379.239250_at_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!!!
>
>

HAVING COUNT(*) > 1 Received on Mon Jul 11 2005 - 09:45:45 CDT

Original text of this message

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