Re: Duplicate entry removal
| From: | Michael Power | Date: | Thu, 27 Feb 2003 11:20:13 +0000 |
| Subject: | Re: Duplicate entry removal | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-18732@lists.php.net to get a copy of this message | ||
Depends if you want records with the same YYYY-MM-DD (my example) or YYYY
(your example).
After re-reading the original post it appears he only wants results as per
your query, oops :)
Cheers
Mike
> -----Original Message-----
> From: Uttam [mailto:uttam@lml.co.in]
>
> isn't it better to just:
>
> SELECT DISTINCT YEAR(<date>) FROM <table>;
>
>
>
> regds,
>
> -----Original Message-----
> From: Michael Power [mailto:michaelpower@concentrix.co.uk]
>
> Better yet define the required dataset with SQL to speed the
> whole process
> up:
>
> "SELECT YEAR(your_date) FROM table_name GROUP BY your_date";
>
> Cheers
> Mike
>
> > "Matt Hillebrand"
> > array_unique()
> >
> > |-----Original Message-----
> > |From: Per Christian [mailto:perchristian@myself.online.no]
> > |
> > |Hi
> > |
> > |I'm building a PHP project for fun, and are going to get
> some dates
> > |from my database (mysql). The problem is that I only want
> the year,
> > |but the date is in the format YYYY-MM-DD so I get the whole column
> > |and remove the -MM-DD part, but now I have a lot of the
> same year Is
> > |there a function or some code that removes duplicate
> entries from a
> > |array?
> > |
> > |Best Regards,
> > |Per Christian
>
>
>
>