MySQL Inner Join Query: incorrect output -
i have mysql query , using inner join in query. due unknown reason not working expected. not sure wrong query. can advise me doing wrong.
here query.
select f.uid, a.uid, b.uid, c.uid, d.uid, e.uid, f.date, a.email, a.fname, a.lname, a.mobile, a.pic, a.address users inner join friends b inner join exp c inner join skill d inner join personaldetails e inner join jobs f on a.uid = b.uid =c.uid = d.uid=e.uid=f.uid f.job_id= 22 , f.ignored=0 , a.fname '%rah%' order f.date desc
if run query suppose a.uid =1, b.uid =1, c.uid =1, d.uid=1, f.uid =1
but getting a.uid =1, b.uid=10, c.uid=10, d.uid=1,e.uid=1,f.uid =1
it seems weird issue, i've tried below.
select 1=10=10=1=1=1 dual;
result 0,
select 10=10=1=1=1=1 dual;
result 1, maybe on a.uid = b.uid =c.uid = d.uid=e.uid=f.uid
query condition take second 1 compute result. i'm not sure if mysql kind of optimized step cause issue when excuting.
i think when mysql compute a.uid = b.uid
if a.uid , b.uid both 1, comes out value 1 means true
, if c.uid 1 computing go on d.uid, e.uid, f.uid.
anyway, try this, may you;)
select f.uid, a.uid, b.uid, c.uid, d.uid, e.uid, f.date, a.email, a.fname, a.lname, a.mobile, a.pic, a.address users a, friends b ,exp c, skill d, personaldetails e, jobs f f.job_id= 22 , f.ignored=0 , a.fname '%rah%' , a.uid = b.uid , b.uid = c.uid , c.uid = e.uid , e.uid = f.uid order f.date desc
if you've found other explanation, share me plz;)
Comments
Post a Comment