close

Privacy guaranteed - Your email is not shared with anyone.

SQL question

Discussion in 'Tech Talk' started by David_G17, Feb 18, 2005.

  1. David_G17

    David_G17 /\/\/\/\/\/\/\/

    Messages:
    2,046
    Likes Received:
    0
    Joined:
    Oct 7, 2002
    edited to add: n/m figured it out :)

    anyone know what this is doing?
    Code:
    SELECT * FROM obituaries WHERE Left(lastname, 1) = '#findalpha.alpha#' ORDER by lastname
    
    What I understand:

    there is a table named obituaries
    #findalpha.alpha# is some cold fusion variable
    "select * from obituaries" means to return all of the table entries in that table
    "order by lastname" is obvious

    what i don't understand:

    "Where Left(lastname, 1)"


    --------------------------------------------------

    is that a left join or something?
     
  2. David_G17

    David_G17 /\/\/\/\/\/\/\/

    Messages:
    2,046
    Likes Received:
    0
    Joined:
    Oct 7, 2002

  3. vote Republican

    vote Republican White and nerdy Moderator

    Messages:
    11,246
    Likes Received:
    2,268
    Joined:
    Aug 23, 2002
    Location:
    OAF Mecca, MD
    I didn't read through that whole page, but it's saying left character for 1 (1st char) of lastname = the bound variable. For example all lastnames starting with 'X'.
     
  4. David_G17

    David_G17 /\/\/\/\/\/\/\/

    Messages:
    2,046
    Likes Received:
    0
    Joined:
    Oct 7, 2002

    yep, that's exactly what it is.