From: Michael Dykman Date: November 25 2009 12:09am Subject: Re: How to concatenate a constant to an int? List-Archive: http://lists.mysql.com/mysql/219489 Message-Id: <814b9a820911241609k2a5ae89cg439f625d6cde6ef3@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable create or replace view view_AllData as select c.name, concat('C',c.contact_id) as ref from contact c On Tue, Nov 24, 2009 at 6:52 PM, Neil Aggarwal wr= ote: > Hello: > > This seems like it should be simple, but I am having trouble > figuring it out. > > I have a table contact which has: > =A0 =A0 =A0 =A0name =A0 =A0 =A0 =A0 =A0 =A0String > =A0 =A0 =A0 =A0contact_id =A0 =A0 =A0int > > Lets assume the contact table has this row: > =A0 =A0 =A0 =A0name: Neil Aggarwal > =A0 =A0 =A0 =A0contact_id: 1 > > I want to create a view that has this data > =A0 =A0 =A0 =A0name: Neil Aggarwal > =A0 =A0 =A0 =A0ref: C1 > > I did this: > > create or replace view > view_AllData as > select > =A0 =A0 =A0 =A0c.name > =A0 =A0 =A0 =A0('C'+c.contact_id) as ref, > from contact c > > but the ref does not have the leading 'C' in > the front of it. > > Any ideas? > > Thanks, > =A0 =A0 =A0 =A0Neil > > -- > Neil Aggarwal, (281)846-8957, http://UnmeteredVPS.net > Host Joomla!, Wordpress, phpBB, or vBulletin for $25/mo > Unmetered bandwidth =3D no overage charges, 7 day free trial > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: =A0 =A0http://lists.mysql.com/mysql?unsub=3Dmdykman@gmail= .com > > --=20 - michael dykman - mdykman@stripped "May you live every day of your life." Jonathan Swift Larry's First Law of Language Redesign: Everyone wants the colon.