You would have to do something like: SELECT * FROM users WHERE CONCAT(firstname, " ", lastname) = "John Smith" That should get you what you want. If your taking your DB from MS SQL to MySQL only a few queries will port directly over. You have to be careful that you follow the MySQL syntax and functions as they are slightly different. -Nick
> > Hi, > > I have a table called users with the columns firstname and lastname. I would > like to do a search on the fullname and have tried: > > select * from users where (firstname + ' ' + lastname) = "John Smith" > > which returns all rows for some reason and not only the rows with users > named John Smith (which SQL Server does). Any ideas? > > Kind regards, Elin > > > > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php