<p>I'm using <code>ColdFusion</code> to return a result set from a SQL database and turn it into a list.</p>

<p>I need some way to generate an alphabetical navigation bar for that list.  I have ColdFusion and the jQuery library available.</p>

<p>I'm looking to generate something like this:</p>

<pre><code>A | B | C | ...      
- A
- A
- B
- B
- B
- C
- D
</code></pre>

<p>Where clicking on one of the letters drops you down the page to the first item for that letter.  Not all 26 letters of the alphabet are necessarily in use.</p>

I would get the SQL result set to return the list in the first place, you can easily just take the first letter of the required item, and a count.  The quickest way would be to do a join on a table of 26 characters (less string manipulation that way).
In CF use the count value to ensure that if there is no result you either only display the letter (as standard text) or dont display it at all.
How many rows are you going to be working on as there may be better ways of doing this.  For example, storing the first letter of your required link field in a separate column on insert would reduce the overhead when selecting.