Solved

Alphabetical Navigation List

Posted on 2001-09-17
1
397 Views
Last Modified: 2010-05-18
I have a long list of items from a DB query and I want to create a navigation bar showing the alphabet with each letter highlighted if there are items begining with that letter. What is the simpliest way to compare my list to the alphabet for this purpose, or easier yet, can I design my query to return a list of all letters used. I know there must be a simple way to do this.
0
Comment
Question by:td234
1 Comment
 
LVL 4

Accepted Solution

by:
heddesheimer earned 50 total points
ID: 6488758
If you have a field "name" in your DB you can try this:

select LEFT(name, 1) as sort_char from table group by sort_char

will just return one record for each Alphabet letter that is in your database

hope that helps

Marian
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question