MySQL SELECT Statment issue

Posted by mouthpiec on Stack Overflow See other posts from Stack Overflow or by mouthpiec
Published on 2010-05-09T20:46:19Z Indexed on 2010/05/09 20:48 UTC
Read the original article Hit count: 294

Filed under:
|
|
|

Hi,

I have the following query which returns 2 tuples

SELECT bar_id, bar_name, town_name, bar_telephone, subscription_type_id, type
FROM towns, subscriptiontype, regions, bar
LEFT JOIN barpictures bp ON bar.bar_id = bp.bar_id_fk
WHERE town_id = town_id_fk
AND bar.test_field = 0
AND subscription_type_id = subscription_type_id_fk
AND region_id = region_id_fk
AND (type like 'logo%' OR type IS NULL) 

The main difference between the tuples is that one has 'type' = logo and the other tuple has 'type' = logo_large. I need that instead of having two tuples, I need that I have 2 type attributes, one holding the "logo" and the other the "logo_large"

eg

bar_id, bar_name, town_name, bar_telephone, subscription_type_id, type1, type2

is this possible

© Stack Overflow or respective owner

Related posts about mysql

Related posts about select