1)table student
studentno varchar(50)
hobby1 varchar(40);
hobby2 varchar(40);
hobby3 varchar(40);
2)if record in data database such that
hobby1 hobby2 hobby3 in this maximum is one must be chose
like
here studentno hobby1 hobby2 hobby3
1 cricket null null
2 null hockey null
3 null null tennis
if i want to write function in mysql if i pass the studentno
i want to get the hobby of respective student
like select functionname(1)
your hobby is cricket
like select functionname(2)
your hobby is hockey
ike select functionname(3)
your hobby is tennis