OPINION OF THE COURT
Memorandum.
The judgment of the Appellate Division should be reversed, without costs, and the petition dismissed.
Defendant was charged in a felony complaint with attempted rape in the first degree and burglary in the first degree. After he rejected a plea offer, his counsel, the District Attorney and the court agreed that a preliminary hearing would be held. At the beginning of the hearing, defense counsel made an application to waive his client’s presence so as to prevent a suggestive identification. The Town Court Justice granted the application, noting that “[t]he District Attorney also has statutory authority to present evidence to a grand jury independent of defendant’s right to a felony hearing and a failure to appear.” The felony hearing was then rescheduled, but on the rescheduled date the People moved, over defendant’s objection, for an adjournment so that the matter could be presented directly to the Grand Jury. The adjournment was granted, the matter was presented to the Grand Jury and defendant was indicted for attempted rape in the first degree and burglary in the first degree. After arraignment in County Court defendant moved to dismiss the indictment for, among other grounds, the People’s failure to conduct a preliminary hearing or, in the alternative, for a postindictment felony hearing.
*720The County Court Judge, in a decision stating that “a defendant has an absolute right to waive his presence at a preliminary hearing” and that “defendant has been deprived of a substantial right and this Court must determine whether the indictment should be dismissed with leave to present to another grand jury after defendant is afforded a preliminary hearing”, granted the motion to the extent of ordering a preliminary hearing at the Town Court and staying all proceedings pending that hearing. The District Attorney then brought on the instant proceeding to prohibit respondents, the County Court Judge and the Town Court Justice, from enforcing the County Court order, on the ground that the County Court had exceeded its jurisdiction.
The Appellate Division granted the application and enjoined the holding of the hearing, stating that County Court had exceeded its jurisdiction and that the grounds stated in the motion were not sufficient in law to warrant dismissal of the indictment (102 AD2d 1022).
Prohibition lies where there is a clear legal right and where a court acts without or in excess of jurisdiction over the subject matter, but does not lie, even if there has been an excess of jurisdiction, if there is available an adequate remedy, by way of appeal or otherwise (Matter of Morgenthau v Erlbaum, 59 NY2d 143; Matter of Morgenthau v Altman, 58 NY2d 1057; Matter of State of New York v King, 36 NY2d 59; see Matter of Schumer v Holtzman, 60 NY2d 46).
Here, because it was clear that if the hearing ordered by County Court was not held the indictment would be dismissed and the People have a right to appeal from such a dismissal (CPL 450.20, subd 1), there was an adequate remedy other than prohibition.
Moreover, it cannot be said under the circumstances of this case that a clear legal right of the District Attorney was threatened by the order of the County Court, his office having agreed to the holding of a preliminary hearing without conditioning its agreement upon defendant’s presence at the hearing. Involved at most for the District Attorney so far as defendant’s nonappearance was concerned was the inconvenience of having to establish defendant’s identity by a means other than corporeal identification (cf. People v Brewster, 63 NY2d 419). True, the People, absent agreement, would have the right to seek an indictment before a preliminary proceeding had been held, but in light of their agreement it cannot be said that the County Court’s order was in excess of jurisdiction any more than was the *721order involved in Matter of Morgenthau v Altman (supra), which concerned the order in which witnesses were to be presented before the Grand Jury. At most, it was an error of law not reviewable by prohibition, even though there may not have been (as here there was) a right of review by way of appeal.