SQL statement

Mikael Hansson EMAIL HIDDEN
Thu May 27 20:55:05 CEST 2010


Kim Johnsson skrev:
> Hejsan!
>
>   
>> I'm having a bit of a trouble getting two different countryvalues in a
>> single select statement
>> ...
>> Does anyone know how to do this?
>>     
>
> 2 countries on the same data row?
>
> select
>   b.bandname,
>   bc.country as bandcountry,
>   cc.country as contactcountry
> from
>   band as b inner join country as bc
>     on b.country_id = bc.country_id
>   inner join contact as c
>     on b.contact_id = c.contact_id
>   inner join country as cc
>     on c.country_id = cc.country_id
>
> maybe? Or with outer joins...
>   
Aah, that looks fine, great Kim! Thanks!

/Micke


__________ Information från ESET NOD32 Antivirus, version av virussignaturdatabas 5151 (20100527) __________

Meddelandet har kontrollerats av ESET NOD32 Antivirus.

http://www.esetscandinavia.com





More information about the music-bar mailing list