Re: Once again ... row to column conversion

2001-02-01 Thread Markus Fischer

On Wed, Jan 31, 2001 at 08:50:44PM +0100, leo.putz wrote : 
 Sorry for having to post the same problem a second time -
 but by now I'm really at a loss.
 Is there really no one out there to give me a hint?
 
 I need the output of a query result (all query information is in one
 row) in one column (!). So, e.g., if you have all temperature lows in
 one row, how can I retrieve the data in form of one column?

How about CONCAT'enating all ?

SELECT CONCAT( id, ' ', temp1, ' ', temp2) as allinone FROM Temp WHERE php meets zimt

m.

-- 
Markus Fischer,  http://josefine.ben.tuwien.ac.at/~mfischer/
EMail: [EMAIL PROTECTED]
PGP Public  Key: http://josefine.ben.tuwien.ac.at/~mfischer/C2272BD0.asc
PGP Fingerprint: D3B0 DD4F E12B F911 3CE1  C2B5 D674 B445 C227 2BD0

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




SQL: row-to-column-conversion in 1 query

2001-01-31 Thread leo.putz

Hi there,

I really get nuts
Macromedia Generator needs COLUMNS to create a chart. But data to be
visualized is stored in one ROW (whole record).

Therefore I need a SQL- query which generates one column out of one row
like:

 my wish:my source:

++
| capt.  |
++...
|  10|+---+---+---+
++- SQL- query  -   | 10| 20| 30|...
|  20|+---+---+---+
++...
|  30|
++
  ...


Every help is appreciated - otherwhise I really will fell the pain..

Thanks in advance

Leo




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: row-to-column-conversion in 1 query

2001-01-31 Thread Johnson, Gregert
 


Re: Once again ... row to column conversion

2001-01-31 Thread Ryan Wahle


Yeah, you should really change the way the database is setup but you
could also do something like this. Have perl return an array and just do
a foreach on the array and that will give you all the values of each
column on the row, without you knowing how many rows there are.

Even if your not using perl you can still do it in other languages.

On 31 Jan 2001 12:10:36 -0800, Eric Fitzgerald wrote:
 Change the way it's stored in the table.
 
 Seriously, if the data is stored in a single row, there is no way via SQL
 (not defined in standards, not available in any SQL server implementation
 I've seen either), then the program has to convert that into columns.  The
 standard mysql utility is capable of doing this, and you can do it in your
 program.
 
 If you want to use the mysql CLI, do something like this:
 mysql --execute='SELECT fields FROM table WHERE condition' --vertical dbname
 
 Otherwise write your program to do it.
 
 - Original Message -
 From: "leo.putz" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, January 31, 2001 11:50 AM
 Subject: Once again ... row to column conversion
 
 
  Sorry for having to post the same problem a second time -
  but by now I'm really at a loss.
  Is there really no one out there to give me a hint?
 
  I need the output of a query result (all query information is in one
  row) in one column (!). So, e.g., if you have all temperature lows in
  one row, how can I retrieve the data in form of one column?
 
  THANKS!
 
 
 
 
  -
  Before posting, please check:
 http://www.mysql.com/manual.php   (the manual)
 http://lists.mysql.com/   (the list archive)
 
  To request this thread, e-mail [EMAIL PROTECTED]
  To unsubscribe, e-mail [EMAIL PROTECTED]
  Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 
 
 
 
 
 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)
 
 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Once again ... row to column conversion

2001-01-31 Thread Rus

If i get it right, you should use CONCAT

- Original Message -
From: leo.putz [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 31, 2001 10:50 PM
Subject: Once again ... row to column conversion


 Sorry for having to post the same problem a second time -
 but by now I'm really at a loss.
 Is there really no one out there to give me a hint?

 I need the output of a query result (all query information is in one
 row) in one column (!). So, e.g., if you have all temperature lows in
 one row, how can I retrieve the data in form of one column?

 THANKS!




 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




row to column conversion

2001-01-29 Thread leo.putz

Hi there!
Macromedia Generator needs a cloumn as query result to create a chart
from given data (e.g. temperature lows).
My data is stored in records (rows).
Does anybody know a SQL syntax to return one column as query result
containing the information from one row.

Any help is greatly appreciated!
Thanks in advance.

Leo


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php