Combining Firstname and Secondname When Searching

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
luketheduck
Forum Newbie
Posts: 18
Joined: Mon Apr 19, 2004 9:13 am
Location: Aylesbury, Bucks, UK

Combining Firstname and Secondname When Searching

Post by luketheduck »

In an SQL SELECT statement, how do I combine FIRSTNAME and SECONDNAME, so that when I search for Bob Smith for example, it merges FIRSTNAME and SECONDNAME to produce the result I want?
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post by Wayne »

there are a couple of ways you could do something like that, but by the sounds of what you are trying to do look into CONCAT or CONCATENATE in your sql manual.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

Wayne wrote:there are a couple of ways you could do something like that, but by the sounds of what you are trying to do look into CONCAT or CONCATENATE in your sql manual.
And CONCAT_WS if it's mysql..
User avatar
luketheduck
Forum Newbie
Posts: 18
Joined: Mon Apr 19, 2004 9:13 am
Location: Aylesbury, Bucks, UK

Post by luketheduck »

Sorted. Cheers for that.
Post Reply