function [query_result,repeated_entries]=simple_database_querier%(select_statement)
%description:  user enters a query on the command line or in this file directly, query is passed through retrieve_data_from_sql_database to the database
%if the query returns filenames, those can be passed to analyze_across_expts to retrieve the relevant info on those files for processing
%calls: retrieve_data_from_sql_database, find_repetitions_in_a_cell_array_input
%called by: command line
%notes: modify the select statement under the no input arguments case and call the mfile from the command line with no argument, then use the returned query_result as the
%argument on the next call from the command line
%code confirmed date: [modification expected]


% if nargin==0
%     select_statement=strcat('SELECT LTP_from_prev_characterization_epoch_pvalue FROM patchlog_epochs_table WHERE LTP_from_prev_characterization_epoch IS NOT NULL')
% elseif nargin==1
%     nomen=strcat(' patchlogfiles_this_epoch = ''',select_statement{1},'''');
%     for patchlogfile=2:length(select_statement)
%         nomen=strcat(nomen,' OR patchlogfiles_this_epoch = ''',select_statement{patchlogfile},'''');
%     end 
%     from_epochs_table=strcat('SELECT first_patchlogfile_this_expt,patchlogfiles_this_epoch,trials_to_ignore,suffix,event_detection_threshold,minutes_per_trial,APs_per_trial,stable_minutes_from_relevant_induction FROM patchlog_epochs_table WHERE (',nomen,') AND suffix=''[]''');     %trials_to_ignore=''[1:43]'' OR trials_to_ignore=''[1:28]'' OR trials_to_ignore=''[66:82]'' OR
%     select_statement=from_epochs_table
% end

%alternate select statem

%str8='20061103T163541'

%select_statement=strcat('select comment FROM patchlog_expts_table INNER JOIN patchlog_epochs_table ON patchlog_expts_table.first_patchlogfile_this_expt = patchlog_epochs_table.first_patchlogfile_this_expt WHERE  patchlog_epochs_table.patchlogfiles_this_epoch LIKE ''', str8,''');

%select_statement=('select first_patchlogfile_this_expt from patchlog_epochs_table where patchlogfiles_this_epoch like ''%patch20070321T104548''')

%select_statement='SELECT comment_on_epoch from patchlog_epochs_table where patchlogfiles_this_epoch like ''%20070321T104548%'''
select_statement='SELECT patchlogfiles_this_epoch from patchlog_epochs_table where first_patchlogfile_this_expt like ''%patch20070321T104548%'''
%select_statement='SELECT comment from patchlog_expts_table where first_patchlogfile_this_expt like ''%patch20070319T115953%'''


%selection_clauses=query_generator;  select_statement=selection_clauses{1}{1}

%select_statement=strcat('SELECT first_patchlogfile_this_expt FROM patchlog_epochs_table WHERE patchlogfiles_this_epoch LIKE ''%patch20060323T225048%''')

%select_statement=strcat('select stable_minutes_from_relevant_induction FROM patchlog_epochs_table WHERE patchlogfiles_this_epoch LIKE ''%patch20070308T143234%''')

%select_statement=strcat('SELECT * FROM patchlog_epochs_table WHERE patchlogfiles_this_epoch LIKE ''%patch20070321T104548%''')

%select_statement=strcat('select conversion_to_mV_or_pA_postsyn_channel from patchlog_epochs_table where first_patchlogfile_this_expt LIKE ''patch20060125T105724''')

%patchlogfiles_this_epoch = 'patch20070319T125639' OR patchlogfiles_this_epoch = 'patch20070308T143234'

%select_statement=strcat('select comment FROM patchlog_expts_table INNER JOIN patchlog_epochs_table WHERE patchlogfiles_this_epoch LIKE '' '' ')

%select_statement=strcat('SELECT color_for_plotting FROM patchlog_expts_table INNER JOIN (',sel,') AS sel ON patchlog_expts_table.first_patchlogfile_this_expt = sel.first_patchlogfile_this_expt')

%select_statement='SELECT first_patchlogfile_this_expt, patchlogfiles_this_epoch, epoch_class_and_sequence, suffix, next_epoch_class_and_sequence, next_C_epoch_if_C_epoch_and_epochs_can_be_compared FROM patchlog_epochs_table WHERE epoch_free_of_significant_technical_problems =1 AND next_C_epoch_if_C_epoch_and_epochs_can_be_compared IS NOT NULL ORDER BY patchlogfiles_this_epoch ASC'

%select_statement='SELECT distinct LTP_from_prev_characterization_epoch FROM patchlog_epochs_table'% WHERE LTP_from_prev_characterization_epoch_pvalue IS NOT NULL'

%select_statement='SELECT patchlog_expts_table.first_patchlogfile_this_expt FROM patchlog_expts_table INNER JOIN patchlog_epochs_table ON patchlog_expts_table.first_patchlogfile_this_expt = patchlog_epochs_table.first_patchlogfile_this_expt WHERE patchlog_expts_table.expt_main_stimulus_class <> ''stdp'' AND patchlog_expts_table.expt_main_stimulus_class <> ''sd'' AND patchlog_epochs_table.epoch_class_and_sequence LIKE ''%C%'' ORDER BY patchlog_expts_table.first_patchlogfile_this_expt ASC';

select_statement_cell{1}=select_statement

query_result=retrieve_data_from_sql_database(select_statement_cell);

repeated_entries=find_repetitions_in_a_cell_array_input(query_result);
end