Try with a self-inflicted left join on the field price.

select a.item,b.item,price 
from table a 
left join table b on a.price=b.price
and a.item!=b.item

You should have:

a.Item   b.Item             Price
 -------------------------------
Item 1                25
Item 2   Item 6       33
Item 3                35

Obviously this works only if there are two items with the same price.
With more than two it doesn't work.

Ciao
Danilo

-----Messaggio originale-----
Da: Claire Forchheimer [mailto:[EMAIL PROTECTED]] 
Inviato: marted́ 17 settembre 2002 11.40
A: [EMAIL PROTECTED]
Oggetto: Simple SELECT/CONCAT query? 



Hi,

I have a question on how to make a simple search...

I have two columns in a MySQLdb-table: item, price
 
I want to list all items with their prices. However, items with the same
price should be concatenated.

 
I've looked through the manual - but can't figure out how to concat
rows....
 
This is the result I'm looking for:
 
Item                Price
 --------------------------
Item 1                25
Item 2, Item 6        33
Item 3                35
etc
 
/claire



---------------------------------------------------------------------
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

Reply via email to