Anand Anand - 2 years ago 60
SQL Question

get the data which are partially filled data in mysql

i have table

data are

id q1_ans q2_ans q3_ans
1. '100' 'Nokia' 'abc'
2. 'IPhone' 'def'
3. '300' 'Samsung' 'ahk'
4. '' '' ''

I required only partially filled data like data of id '2'

Answer Source
select q1_ans, q2_ans, q3_ans FROM table WHERE 
    q1_ans='' OR q2_ans='' OR q3_ans='' 
    AND NOT (q1_ans='' AND q2_ans='' AND q3_ans='');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download