1052: Column 'id' in field list is ambiguous

前端 未结 8 1960
面向向阳花
面向向阳花 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:52

    You would do that by providing a fully qualified name, e.g.:

    SELECT tbl_names.id as id, name, section FROM tbl_names, tbl_section WHERE tbl_names.id = tbl_section.id
    

    Which would give you the id of tbl_names

提交回复
热议问题