Do you want to know how to query check box field? it can be done as below say your checkbox field is Opt_out__c and you wish you extract those fields for whom the Opt_out_c field is set to true, then your query will be as under:-
Select id, Name, Opt_out__c from Contact where Opt_out__c ='true'
Second part of your question is not clear please do elaborate.
What exactly is you requirement?
Do you want to know how to query check box field? it can be done as below say your checkbox field is Opt_out__c and you wish you extract those fields for whom the Opt_out_c field is set to true, then your query will be as under:-
Select id, Name, Opt_out__c from Contact where Opt_out__c ='true'
Second part of your question is not clear please do elaborate.
Are you looking for this
http://wiki.developerforce.com/index.php/Checkbox_in_DataTable