Don't forgot the quotes around the URL:
SELECT CONCAT('<A HREF="', url, '">', state, '</A>') AS link FROM nads;
Michael
David Rodman wrote:
You mean something like this?
mysql> create table nads( -> state varchar(50), -> url varchar(100)); Query OK, 0 rows affected (0.03 sec)
mysql> insert into nads values('California', 'http://www.california.gov'); Query OK, 1 row affected (0.00 sec)
mysql> insert into nads values('Florida', 'http://www.florida.gov'); Query OK, 1 row affected (0.00 sec)
mysql> SELECT CONCAT('<A HREF=', url, '>', state, '</A>') as link from nads; +--------------------------------------------------+ | link | +--------------------------------------------------+ | <A HREF=http://www.california.gov>California</A> | | <A HREF=http://www.florida.gov>Florida</A> | +--------------------------------------------------+ 2 rows in set (0.05 sec)
-----Original Message----- From: David Blomstrom [mailto:[EMAIL PROTECTED] Sent: Saturday, June 26, 2004 8:07 PM To: [EMAIL PROTECTED] Subject: Merging 2 Fields
I think I recall a thread where someone mentioned merging two fields. If that can be done, I'd like to know how.
For example, suppose I have a field filled with place names, next to a field filled with links:
California | <http://www.california.gov/> Florida | <http://www.florida.gov/>
I'd like to merge the columns, so the two columns are displayed as one:
<http://www.california.gov/>California
I'd have to add the closing </a> tag somehow, but I think I know how to do that.
So how do you merge fields?
Thanks.
__________________________________ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]