如何从mysql数据库中排除'0000-00-00'到下拉列表中的最小日期

I want to retrieve date from database with exclude 0000-00-00 into dropdown list. I tried using MIN() function but it show the year from zero to current year.

<?php //year

    $earliest_year = "SELECT MIN(YEAR(appl_date)) FROM table WHERE YEAR(appl_date)> '0000-00-00'";
    $latest_year = date('Y'); 

?>

    <select name="year" style="width:60px;">
    <option value=""><?php echo $latest_year;?></option>

<?php 

    foreach ( range( $latest_year, $earliest_year ) as $year ) {
          $selected = ($year == 'year') ? 'selected' : '';
          echo '<option '.$selected.' value="'.$year.'">'.$year.'</option>';
                    } 

?> 
</select>

The expected result is to show the date from minimum to current year from database.

You can try this query:

SELECT MIN(YEAR(appl_date)) FROM table WHERE appl_date > 0

Try this :

SELECT MIN(YEAR(appl_date)) FROM table WHERE YEAR(appl_date) IS NOT NULL