database - checking different data value in a same column mysql query? -


id_detail_item id_item   id_detail_item_name 1              1         abc  2              1         abcd 3              1         cde 4              3         zki 5              3         zkr 

how check if there 2 different data in "id_detail_item_name" in same "id_item"?

i've tried following, got error:

select id_item table_detail_item id_detail_item_name='abc' , id_detail_item_name='abcd'; 

this should list entries @ least 2 different id_detail_item_name id_item

select id_item, min(id_detail_item_name) nam1,max(id_detail_item_name) nam2  table_detail_item  group id_item having min(id_detail_item_name) nam1<max(id_detail_item_name) 

Comments

Popular posts from this blog

Line ending issue with Mercurial or Visual Studio -

tags - Jquery Mixitup plugin help prevent handlers being destroyed -

c# - Delving into the world of XML (Windows Phone) Error I dont understand (The ' ' character, hexadecimal value 0x20, cannot be included in a name.) -