Re: ABC listings
| From: | DL Neil | Date: | Tue, 08 Jan 2002 16:46:55 +0000 |
| Subject: | Re: ABC listings | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-15503@lists.php.net to get a copy of this message | ||
> >I would like to set up one of those " A B C D E F " page listings. How do
> >i query the database to grab the first letter from each entrey.
>
> Barry try something such as
>
> select info from mytab
> where name like "$ltr%";
Barry,
What you have asked for ("from each entrey" [sic]) is:
SELECT LEFT( colNm, 1 ) FROM tblNm;
However what may be of more use is:
SELECT DISTINCT LEFT( colNm, 1 ) FROM tblNm;
6.3.2 String Functions
6.4.1 SELECT Syntax
=dn