sql - Mysql query issue with left join -


I have two tables and try to join them both on the basis of primary and foreign keys. But the problem is that in the second table there are duplicate lines in the foreign key.

1 table - category

  catid catname 1aa2bbb3ccc   

2 table - answer

  ansid catid 1 1 2 1 3 2 4 2   

should be the result

  catid catname Currently answer table 1 aaa yes 2bbb Yes 3 ccc no   

My query

  Skip to select category * category.catid = answers.catid Join Answer at   < Select / div> 

text ">

  c.cidid, c.catname, in the case when the amount (a.catid is not empty)> gt and then 'no' and 'yes' As current_ As N_shansrs_tag a north Leave the Class C c.catid = a.catid group c.catid, c.catname    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -