List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:January 7 2003 5:12pm
Subject:Re: Weird WHERE clause possible?
View as plain text  
At 10:37 -0500 1/7/03, Lefevre, Steven wrote:
>I'm developing a web-site database. There is a form on one page where a user
>can search for a student by typing in a last name and submitting it.
>
>Sometimes there can be more than one student with the same last name, so I
>want the user to be able to type in "Smith, J" (where normally they type
>'Smith').
>
>The problem (as I see it) is that I'm storing the last name and the first
>name in two seperate fields. I can make an SQL statement like "Select * from
>Students Where LastName Like "Smith%";", but can I make something like
>
>"SELECT * FROM Students WHERE (LastName, ", ", FirstName) AS Name LIKE
>"Smith, J%";"
>?

You might find the CONCAT() function useful for this.
Thread
Weird WHERE clause possible?Steven) (Lefevre7 Jan
  • Re: Weird WHERE clause possible?Steven) (Lefevre7 Jan
    • Re[2]: Weird WHERE clause possible?Brian Lindner7 Jan
    • Re: Weird WHERE clause possible?Brent Baisley7 Jan
  • Re: Weird WHERE clause possible?Paul DuBois7 Jan
  • Re: Weird WHERE clause possible?Diana Soares7 Jan
  • Re: Weird WHERE clause possible?Ryan Fox8 Jan