1052: Column 'id' in field list is ambiguous

前端 未结 8 1958
面向向阳花
面向向阳花 2020-11-22 13:17

I have 2 tables. tbl_names and tbl_section which has both the id field in them. How do I go about selecting the id field,

8条回答
  •  时光取名叫无心
    2020-11-22 13:45

    What you are probably really wanting to do here is use the union operator like this:

    (select ID from Logo where AccountID = 1 and Rendered = 'True')
      union
      (select ID from Design where AccountID = 1 and Rendered = 'True')
      order by ID limit 0, 51
    

    Here's the docs for it https://dev.mysql.com/doc/refman/5.0/en/union.html

提交回复
热议问题