mysql query to get not repeated data and multiple where statements -


i have trouble creating query should have 2 , statements in where.

example table:

type_id       type 00034         1 00035         2 00035         3 00036         2 00037         3 

i'm looking type_id doesn't have repeated id , type not 1 or 3. expected result 00036. not working:

select type_id test type_title !=1 group type_id having count(type_id) = 1 

result is:

00036 00037 

how make 00036?

best regards & nice weekend!

let's assume table name "test_table", following query return need:

select t1.type_id test_table t1 join test_table t2 on t1.type_id = t2.type_id t2.type not in(1,3) group t1.type_id having count(t1.type_id) = 1; 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -