SQL question

Results 1 to 3 of 3

Thread: SQL question

  1. #1
    Ariel Kahana Guest

    Default SQL question

    I have a column with names(first name, sometime a middle name and a last name) and I want to find all the people whose last name starts with a certin letter. <BR>I am sure that there is some SQL statment that can start to check from the end of the record, find the first space and then find out what is the letter that is to the right of this space but I can&#039t seem to find it - Help<BR><BR>Thanks<BR>Ariel

  2. #2
    Join Date
    Dec 1969
    Posts
    511

    Default RE: SQL question

    You want to use the LIKE statement with the % wildcard for this one. This example will return all the people whos last name begins with a &#039H&#039.<BR><BR>SELECT * <BR>FROM MyTable<BR>WHERE Lastname LIKE &#039H%&#039<BR><BR>Pete

  3. #3
    Join Date
    Dec 1969
    Posts
    36

    Default RE: SQL question

    I wish I had a "Lastname" field! <BR>My problem is that in the same field I have the first and last (and sometimes the middle)name.<BR>The format that they are written in the field is <BR>"first name middle name last name"

Posting Permissions

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