SQL ORDER String(NumberOrder / CurrentYear)来自两个表

I have TABLE ONE and TABLE TWO and both have a field named "n_inscription"

I have this value saved in both tables as VARCHAR to a MySQL database as "n_inscription" LIKE This (NumberOrder/CurrentYear). Example: 1/2013, 2/2013, 13/2014, ....etc in (TABLE ONE) AND TABLE TWO have these values

1/2014, 2/2014,  5/2013...

I tried this QUERY :

$list_students = array();

$sql_students = $mysqli->query("SELECT * FROM `es_student_infos`
                                        WHERE school_year='".$school_year."'                                                                    
                                        ORDER BY
                                        CAST(RIGHT(n_inscription, 4) AS UNSIGNED) ASC,
                                        CAST(LEFT(n_inscription, LOCATE('/', n_inscription) - 1) AS UNSIGNED) ASC");

        while($data1 = $sql_students->fetch_object()){
            $list_students[] = $data1;
        }

        $sql_students2 = $mysqli->query("SELECT * FROM `es_upgrades`
                                        WHERE school_year='".$school_year."'                                                                    
                                        ORDER BY
                                        CAST(RIGHT(n_inscription, 4) AS UNSIGNED) ASC,
                                        CAST(LEFT(n_inscription, LOCATE('/', n_inscription) - 1) AS UNSIGNED) ASC");

        while($data2 = $sql_students2->fetch_object()){
            $list_students[] = $data2;
        }

// RETRIEVE DATA :

foreach($list_students AS $student): 
............
endforeach;

The problem here in this query is that it SORTs data from the first table and then sorts data from the second table and it gives me result like this:

1/2013| 2/2013 | 13/2014 | 5/2013 | 1/2014 | 2/2014 | 

It seems the query starts sorting data from table one and when it finishes sorting data it starts again sort data from TABLE TWO.

I want to sort data from both tables at the same time to give me result like this:

1/2013| 2/2013 | 5/2013 | 1/2014 | 2/2014 | 13/2014 |

and NOT

1/2013| 2/2013 | 13/2014 | 5/2013 | 1/2014 | 2/2014 |

the tables structure:

Table one:

 `es_student_infos` (
  `id_student` int(11) NOT NULL,
  `id_grade` int(11) NOT NULL,
  `id_class` int(11) NOT NULL,
  `n_inscription` varchar(255) NOT NULL,
  `date_inscription` date NOT NULL,
  `cne` varchar(255) NOT NULL,
  `nom_fr` varchar(255) NOT NULL,
  `nom_ar` varchar(255) CHARACTER SET utf8 NOT NULL,
  `prenom_fr` varchar(255) NOT NULL,
  `prenom_ar` varchar(255) CHARACTER SET utf8 NOT NULL,
  `date_naissance` date NOT NULL,
  `lieu_naissance_ar` varchar(255) CHARACTER SET utf8 NOT NULL,
  `lieu_naissance_fr` varchar(255) NOT NULL,
  `tel` varchar(255) NOT NULL,
  `sexe` varchar(10) CHARACTER SET utf8 NOT NULL,
  `ancien_niveau_scolaire` varchar(255) CHARACTER SET utf8 NOT NULL,
  `date_ancienNiveauScolaire` varchar(10) NOT NULL,
  `ancienne_ecole` varchar(255) CHARACTER SET utf8 NOT NULL,
  `type_ecole` varchar(255) CHARACTER SET utf8 NOT NULL,
  `type_inscription` varchar(20) CHARACTER SET utf8 NOT NULL,
  `assurance` int(11) NOT NULL,
  `mensualite` int(11) NOT NULL,
  `nom_tuteur` varchar(255) CHARACTER SET utf8 NOT NULL,
  `profession_tuteur` varchar(255) CHARACTER SET utf8 NOT NULL,
  `adresse_tuteur` varchar(255) CHARACTER SET utf8 NOT NULL,
  `tel_tuteur` varchar(255) NOT NULL,
  `remarques` text CHARACTER SET utf8 NOT NULL,
  `photo` varchar(255) NOT NULL,
  `school_year` varchar(10) NOT NULL,
  `cours_type` enum('jour','soir') NOT NULL,
  `id_subject` int(11) NOT NULL,
  `id_prof_soir` varchar(30) NOT NULL,
  `montant_soir` varchar(255) NOT NULL,
  `archived` enum('0','1') NOT NULL

Table TWO:

  `es_upgrades` (
      `id_upgrade` int(11) NOT NULL,
        `id_student` int(11) NOT NULL,
         `n_inscription` varchar(20) NOT NULL,
         `old_id_class` int(11) NOT NULL,
         `new_id_class` int(11) NOT NULL,
         `status` enum('up','down') NOT NULL,
         `school_year` varchar(30) NOT NULL,
         `date_inscription` date DEFAULT NULL,
         `cne` varchar(255) DEFAULT NULL,
         `nom_fr` varchar(255) DEFAULT NULL,
         `nom_ar` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
         `prenom_fr` varchar(255) DEFAULT NULL,
         `prenom_ar` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
         `date_naissance` date DEFAULT NULL,
         `lieu_naissance_ar` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
         `lieu_naissance_fr` varchar(255) DEFAULT NULL,
         `tel` varchar(255) DEFAULT NULL,
         `sexe` varchar(10) CHARACTER SET utf8 DEFAULT NULL,
         `ancien_niveau_scolaire` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
         `date_ancienNiveauScolaire` varchar(10) CHARACTER SET utf8 DEFAULT NULL,
         `ancienne_ecole` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
         `type_ecole` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
         `type_inscription` varchar(20) CHARACTER SET utf8 DEFAULT NULL,
         `assurance` int(11) DEFAULT NULL,
         `mensualite` int(11) DEFAULT NULL,
         `nom_tuteur` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
         `profession_tuteur` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
         `adresse_tuteur` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
         `tel_tuteur` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
         `remarques` text CHARACTER SET utf8,
         `photo` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
         `cours_type` enum('jour','soir') CHARACTER SET utf8 DEFAULT NULL,
         `id_subject` int(11) DEFAULT NULL,
         `archived` enum('0','1') DEFAULT NULL

UNION should works but it will work only with tables with same number of columns or if you specified columns you need (in orther words you cannot use * symbol)

UNION should works but it will work only with tables with same number of columns or if you specified columns you need (in orther words you cannot use * symbol)

So, if you have the tables like tables:

CREATE TABLE a
(
 id SERIAL,
 dat DATE,

 PRIMARY KEY (id)
);

and

CREATE TABLE b
(
 id SERIAL,
 dat DATE,
 ip VARCHAR(16),

 PRIMARY KEY (id)
);

you should use such request

SELECT dat FROM a
UNION 
SELECT dat FROM b;

then it should works.

And read this topic (especially second answer (with 7 votes)) it may helpful: Order by descending date - month, day and year