I need sql statment to do( select one comlmn if another is have defrent value) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I need sql statment to do( select one comlmn if another is have defrent value)

sql

27th Oct 2018, 4:08 PM
‏‪Mohammad Abu Al Arayes‬‏
8 Answers
+ 2
Unfortunately there is no sql play ground so I cannot test my statement. What you are looking for is the opposite of distinct which is group by having count > 1 Select name, status from table1 group by name having count > 1
27th Oct 2018, 8:49 PM
sneeze
sneeze - avatar
+ 1
Please explain the question a bit more. I think it is a good question but I do not understand the question with the information you gave. Can you show use a example ?
27th Oct 2018, 8:09 PM
sneeze
sneeze - avatar
+ 1
Thank you for your explanation. I do understand your question better now. Unfortunately I still do not understand everything What is the result you expect based on the columns you have given ?
27th Oct 2018, 8:39 PM
sneeze
sneeze - avatar
+ 1
Thank you now I understand. The question is clear to me, let me think about the statement.
27th Oct 2018, 8:41 PM
sneeze
sneeze - avatar
0
thanks for you i have two column: name status ______ _______ mh active mh busy go active has active has offline has busy yas busy I wana select name and status if is name have a many and defrent status I hope my ex is is good thanks
27th Oct 2018, 8:32 PM
‏‪Mohammad Abu Al Arayes‬‏
0
I need below result: name status ______ ______ mh active mh busy has active has offline has busy
27th Oct 2018, 8:39 PM
‏‪Mohammad Abu Al Arayes‬‏
0
many thanks for you
27th Oct 2018, 8:44 PM
‏‪Mohammad Abu Al Arayes‬‏
0
thanks I will try and back
28th Oct 2018, 4:15 AM
‏‪Mohammad Abu Al Arayes‬‏