Groups > Databases > MySQL for ASP.NET > Re: how to joint to varchar field to display as one field,




how to joint to varchar field to display as one field,

how to joint to varchar field to display as one field,
Mon, 31 Mar 2008 10:51:16 +000
Dear forum member,

 

I have table having field like 

UserID    FName    MName    LName Gender

 1          John         Mark       Henery  male

I want to write query in MySQL to Display Like 

UserID    Name                          Gender

1            John Mark henery          Male

below code is working in SqlServer where as not in MySql 

select UserID , Fname+' '+Mname+' '+lname as StName from  Test  how to write in
MySql ,
Post Reply
Re: how to joint to varchar field to display as one field,
Mon, 31 Mar 2008 10:57:21 +000
try to use a concationation function: CONCAT (str1,str2,...)
Post Reply
Re: how to joint to varchar field to display as one field,
Mon, 31 Mar 2008 12:34:17 +000
Can you explain with some example

Any ways Thanks for your reply
Post Reply
Re: how to joint to varchar field to display as one field,
Mon, 31 Mar 2008 13:22:53 +000
select UserID , CONCAT(Fname,Mname, lname) as StName from  Test :)
Post Reply
Re: how to joint to varchar field to display as one field,
Mon, 31 Mar 2008 13:26:04 +000
This way is not working in MySQL, it giving error like FUNCTION concat does not
exist
Post Reply
<< Previous 1 2 Next >>
( Page 1 of 2 )
about | contact