sql - Select rows which meets criteria and do not -


i have table feature , feature_details feature_details can have lot of features.

  feature_details   feature_deatails_id | feature_id   1                        1   1                        2   1                        4    2                        1   2                        2   2                        4   2                        5 

i have blocker in selecting feature_deatails_id's have e.g. 5 feature_id or null absent. output should be:

feature_deatails_id | feature_id 1                     null 2                     5 

for example

select feature_deatails_id, min(case feature_id when 5 feature_id end) feature_id my_table group feature_details_id  

Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -