mysql - Having SQL Query not group results -


i have sql query joins few tables user_id, problem is see data these tables.

at moment querying user table , payment table , joining them based on user_id.

i seem getting 1 result per user_id, know meant happen how (if possible), able show data payment table (ie want see multiple user ids show various payments user has made).

i using left join, i'm thinking may issue switching still isn't showing results looking for.

this current join:

from user u  left join u_subscription  on u.user_id = us.user_id  left join u_detail ud  on u.user_id = ud.user_id 

any hugely appreciated.

thanks in advance

nad

full sql query:

select u.user_id 'prop:user id', u.user_username 'prop:username', u.user_email 'identity',u.user_created 'timestamp', us.user_subscription_expires 'prop:expires on', us.user_subscription_payment_provider 'prop:payment provider', us.user_subscription_modified, ud.user_detail_signup_country_iso3 'prop:country'  user u left outer join user_subscription on u.user_id = us.user_subscription_user_id left outer join user_detail ud on u.user_id = ud.user_detail_user_id 

i find no flaws in query. should working expected.

i'm suspecting there no more 1 row per user in subscription , detail tables. that's why left join produces 1 row per user (if inner join, produce at most 1 row per user).


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -