Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2016

    Unanswered: Generating an alphanumeric sequence

    I need to generate an alphanumeric string sequence using the algorithm:

    Letter - Letter - Number - Number - Letter - Number - Number - Number


    For example, the start of the sequence would be AA00A000. The sequence should increment each column in turn. Once you reach AA00A999, the next item in the sequence should be AA00B000. When you reach AA00Z999, the next item in the sequence should be AA01A000, and so on...

    I have found several methods for generating random strings, but none that generate sequential strings.

    I would prefer to do this purely in MySQL, but if that is not possible I could generate it in PHP.

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    your best bet of doing this in MySQL would be to use a stored procedure, assuming you are using a version of MySQL that supports SP's or stored functions
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts