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




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