query from alphabet links A B C....Z ???

Discussions

Web tier: servlets, JSP, Web frameworks: query from alphabet links A B C....Z ???

  1. query from alphabet links A B C....Z ??? (1 messages)

    Hi, I want to have links called A B C D ....Z, and whenever the user click in one of them, all the rows that has employee last name start with this alphapet or greater get selected.
    Thanks
  2. Majid, you could be asking several questions. I'll just try to answer one. In SQL, you can typically find all items beginning with a particular alphabetic character in one of two ways:

    1) SELECT * FROM table WHERE field LIKE "A*"

    -or-

    2) SELECT * FROM table WHERE (field >= "A") AND (field < "B")

    If your 'field' can begin with both upper and lower case alphabetic letters ('a' and 'A'), then you'll need to add additional WHERE clauses to snag those as well.

    Hope that gets you started,

    Gordon.