pda4me
asked on
MySQL Query combine two columns in PHP
I am using the following MySQL query in PHP. How do I combine the values in each record for StreetNu and StreetNa into a single column of data using this query? Right now it splits them out as two seperate columns.
SELECT MLNumber AS Home_ID, StreetNu AS StreetNumber, StreetNa AS StreetName City AS City, State AS State, ZipCode AS zip, MarketingRemarks AS description, SubdivisionDisplay AS neighborhood, ListingPrice AS price, VirtualTourURL AS virtual_tour_1, Bedrooms AS bedrooms, Bathrooms AS bathrooms_full, SquareFootage AS living_area FROM MyTable
SELECT MLNumber AS Home_ID, StreetNu AS StreetNumber, StreetNa AS StreetName City AS City, State AS State, ZipCode AS zip, MarketingRemarks AS description, SubdivisionDisplay AS neighborhood, ListingPrice AS price, VirtualTourURL AS virtual_tour_1, Bedrooms AS bedrooms, Bathrooms AS bathrooms_full, SquareFootage AS living_area FROM MyTable
select CONCAT(StreetNu , ' ', StreetNa ) streetinfo from mytable
ASKER
that does not work when I try to insert into the existing sql statement?
to be more clear I need StreetNu and StreetNa to be a column (AS) called StreetInfo just like the other column treatments you see.
to be more clear I need StreetNu and StreetNa to be a column (AS) called StreetInfo just like the other column treatments you see.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
thanks!