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

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -