A writ of certiorari shall be granted by the supreme court or district court when an officer, board, tribunal, or inferior court has exceeded the jurisdiction of such officer, board, tribunal, or inferior court, as the case may be, and there is no appeal, nor, in the judgment of the court, any other plain, speedy, and adequate remedy, and also when, in the judgment of the court, it is deemed necessary to prevent miscarriage of justice.
N.D.C.C. § 32-33-01