Re: Combining Columns in MySQL for PHP
| From: | Chris Earle | Date: | Sat, 27 Jul 2002 20:08:01 +0000 |
| Subject: | Re: Combining Columns in MySQL for PHP | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-110000@lists.php.net to get a copy of this message | ||
Thanks for the reply, and I see that I didn't get specific enough (my fault!
sorry).
Here's what I want to take from:
+-----+------+
| col_1| col_2 |
+-----+------+
| 2.0 | 6.8 |
+-----+------+
| 4.1 | 8.9 |
+-----+------+
I want to do something like SELECT COMBINE(col_1, col_2) as col FROM
column_list ORDER BY col;
Which would give me:
+---+
| col |
+---+
| 2.0 |
+---+
| 4.1 |
+---+
| 6.8 |
+---+
| 8.9 |
+---+
CONCAT would only work if I want strings concatenated on the same row. Is
there some way I can use JOIN to get what I want?
"John Holmes" <holmes072000@charter.net> wrote in message
news:000201c235a7$59348560$b402a8c0@mango...
> > SELECT COMBINE(column_1, column_2) As column FROM column_list;
> >
> > Would give me the results of column_1 and column_2 simply by going
> through
> > "column".
>
> Use CONCAT() where you have COMBINE().
>
> ---John Holmes...
>