Hi I have below table structure shown in image
I am trying to write query in mysql to fetch
name,address,mono from customer table or vendortable depend on whoseid value from transportsticker table
I tried as
SELECT transportsticker.* ,AA.name,AA.address,AA.mono FROM transportsticker INNER JOIN (case when (transportsticker.whoseid='vendor') then (vendortable) else (customertable) end) AA ON AA.id=transportsticker.vorcid AND transportsticker.id=1
But it is giving syntax error. can anybody help me...?
Aucun commentaire:
Enregistrer un commentaire