
767 So.2d 343 (2000)
Ex parte JEFFERSON COUNTY et al.
(In re Jason Richards et al. v. Jefferson County et al.)
1982281.
Supreme Court of Alabama.
March 17, 2000.
*344 William M. Slaughter and John W. Scott of Haskell, Slaughter & Young, L.L.C., Birmingham; and Jeffrey M. Sewell, Jefferson County Attorney, for petitioners.
William J. Baxley and Joel E. Dillard of Baxley, Dillard & Dauphin, Birmingham, for respondents.
PER CURIAM.
Jefferson County, the defendant in a class action pending in the Jefferson Circuit Court, petitions for a writ of mandamus directing the trial court to dismiss that action on the ground of lack of subject-matter jurisdiction. We deny the writ.
The class action was filed by certain Jefferson County taxpayers, on behalf of all Jefferson County taxpayers; the plaintiffs claimed, among other things, that an "occupational tax," which was authorized by Ala. Acts 1967, Act No. 67-406 (not codified), and implemented by Jefferson County Ordinance No. 1120, violated the Equal Protection Clause of the Fourteenth Amendment to the United States Constitution. The trial court held the tax unconstitutional. The only substantive issue raised by Jefferson County in this petition is whether the trial court should have dismissed the action for lack of subject-matter jurisdiction. The county argues that the plaintiff taxpayers failed to timely serve the attorney general under Ala.Code 1975, § 6-6-227, and, therefore, that the trial court never acquired jurisdiction to rule on the constitutional challenge.
The threshold issue presented by this petition is whether a petition for the writ of mandamus is an appropriate means for securing a review of the jurisdiction question. The trial court ruled that § 4 of Act No. 67-406 and § 1(B) of Ordinance No. 1120 are unconstitutional, on the ground that certain exemptions authorized by the act and included in the ordinance cause the tax to violate the Equal Protection Clause. In addition, the court enjoined Jefferson County from collecting the tax unless the county does so without applying the exemptions. The court also ordered that "[t]he tax receipts collected from the previously exempted taxpayers" be placed in an interest-bearing escrow account until the class action, particularly the remedy phase, can be concluded. Before filing this petition, Jefferson County had filed an appeal under Rule 4(a)(1)(A), Ala. R.App. P.; that rule allows an appeal from "any interlocutory order granting, continuing, modifying, refusing, or dissolving an injunction, or refusing to dissolve or modify an injunction." That appeal is presently pending in this Court (Jefferson County v. Richards, Docket No. 1981680). Jefferson County concedes that its appeal raises a number of substantive issues, including the merits of the constitutional issue and the jurisdiction issue raised by this petition. We stayed Jefferson County's appeal when we ordered an answer and briefs in connection with this petition.[1]
*345 A writ of mandamus is an extraordinary remedy that we have consistently held will issue only in situations where other relief is unavailable or is inadequate. See Ex parte Empire Fire & Marine Ins. Co., 720 So.2d 893, 894 (Ala.1998). This Court has stated:
"It is now a well-established general rule in this state that if the matters complained of can ultimately be presented by an appeal, a writ of mandamus will not be issued. Ex parte Fowler, 574 So.2d 745 (Ala.1990). However, this Court, exercising its discretion, has recognized certain exceptions to this general rule in specific cases where appeals are not considered to be adequate to prevent `undue injury.'"
Ex parte Spears, 621 So.2d 1255, 1256 (Ala.1993). (Citations omitted.) Jefferson County contends that the delay that would be incurred by this Court's resolving the jurisdiction issue on appeal rather than in response to this mandamus petition would cause an "undue injury." After carefully considering the arguments of the parties, we are not persuaded that a petition for the writ of mandamus is the appropriate procedural vehicle for presenting this issue. However, because we stayed Jefferson County's appeal pending our consideration of this petition, we believe it would be inappropriate to further delay our consideration of the jurisdiction issue. Therefore, in order to facilitate the resolution of the pending litigation, we will address that issue. See Rule 1, Ala. R.App. P.
Section 6-6-227 provides that when the constitutionality of a state statute is challenged the attorney general must be served with a copy of the complaint, in order to allow him to represent the interests of the people of the State of Alabama.[2] See Board of Trustees of Employees' Retirement System of the City of Montgomery v. Talley, 291 Ala. 307, 280 So.2d 553 (1973). In interpreting § 6-6-227, this Court has consistently held that the failure to serve the attorney general will deny the trial court jurisdiction to resolve any claim based on the constitutional challenge. See Bratton v. City of Florence, 688 So.2d 233, 234 (Ala.1996). Any ruling that a trial court makes on a constitutional issue, when the attorney general has not been given notice and the opportunity to intervene, is void. See Ex parte St. Vincent's Hosp., 652 So.2d 225 (Ala.1994); Fairhope Single Tax Corp. v. Rezner, 527 So.2d 1232 (Ala.1987). See, also, Busch Jewelry Co. v. City of Bessemer, 266 Ala. 492, 493, 98 So.2d 50, 51 (1957). However, nowhere in § 6-6-227 or in Alabama caselaw do we find any requirement that the attorney general be served at any specific time during the litigation. This Court has stated:

*346 "[Section 166, Title 7, Code of 1940 (Recomp.1958) (the predecessor to § 6-6-227)] does not say when [the attorney general] must be served or that the respondents cannot plead until he has been served. We will not now attempt to say when he must be served."
Ex parte Dothan-Houston County Airport Auth., 282 Ala. 316, 321, 211 So.2d 451, 455 (1968); see, also, City of Mobile v. Salter, 287 Ala. 660, 664, 255 So.2d 5, 7 (1971) ("The fact that the attorney general is not served or does not file a waiver early in the proceedings does not deprive the trial court of jurisdiction."); Armstrong v. Roger's Outdoor Sports, Inc., 581 So.2d 414 (Ala.1990) (where this Court remanded for the appellant, pursuant to § 6-6-227, to notify the attorney general of his constitutional challenge within 90 days of the remand).
The record before us indicates that the taxpayers served the attorney general on April 20, 1998. The record and briefs also indicate that hearings to determine the constitutionality of Act No. 406 and the corresponding county ordinance were held both before and after the attorney general had been served. The trial court did not rule on the constitutional issue until November 12, 1998, approximately six and one half months after the attorney general had been served. The attorney general clearly had notice of the action; the record indicates that he was notified in sufficient time that he could have moved to intervene in the case if he had felt that it was necessary to do so. However, the record does not indicate that he filed a motion for a continuance, a motion to intervene, or any other motion that would indicate that he wished to be heard on the matter.[3] See Talley, supra, wherein this Court addressed the issue whether the trial court lost jurisdiction because the attorney general had not been served with two amendments to the complaint:
"The purpose of the provisions of Title 7, § 166 [Code of 1940 (Recomp.1958), the predecessor to § 6-6-227] is to give notice of the filing of the [complaint], and protect the state and its citizens should the parties be indifferent to the outcome of the litigation. This purpose has been served in this case, and the Attorney General has filed no answer or other pleadings in the case indicating that he wished to be heard, nor has he complained of the lack of service of the amendments [to the complaint]. Under such circumstances this court can only conclude that there was certainly a substantial compliance with the provisions of Title 7, § 166...."
291 Ala. at 310, 280 So.2d at 555. (Citations omitted.) Therefore, based on the record before us, we conclude that the trial court had subject-matter jurisdiction.
For the reasons stated above, we deny the writ.
WRIT DENIED.
HOOPER, C.J., and MADDOX, HOUSTON, COOK, SEE, LYONS, BROWN, and ENGLAND, JJ., concur.
JOHNSTONE, J., concurs specially.
JOHNSTONE, Justice (concurring specially).
I agree with the main opinion in its analysis of the merits of the jurisdictional *347 issue, and I agree with the denial of the writ of mandamus. Because I also agree that, "we are not persuaded that a petition for the writ of mandamus is the appropriate procedural vehicle for presenting this issue," 767 So.2d 345, however, I think the writ should have been denied on this procedural ground rather than on the merits. We will soon eviscerate our general rule against using mandamus to achieve interlocutory appeals if we make an unrecognized exception to the general rule by addressing the merits of an unauthorized petition for writ of mandamus through some sense of convenience or judicial economy. These very considerationsjudicial economy and a balancing of the conflicting convenience interests of the respective partiesare the reasons for the general rule in the first place.
NOTES
[1]  The taxpayers have moved to dismiss the appeal; however, because of our order staying the appeal, we have not yet ruled on their motion.
[2]  Section 6-6-223 provides:

"Any person interested under a deed, will, written contract, or other writings constituting a contract or whose rights, status, or other legal relations are affected by a statute, municipal ordinance, contract, or franchise may have determined any question of construction or validity arising under the instrument, statute, ordinance, contract, or franchise and obtain a declaration of rights, status or other legal relations thereunder."
(Emphasis added.) Section 6-6-227 provides that "if the statute, ordinance, or franchise is alleged to be unconstitutional, the Attorney General of the state shall also be served with a copy of the proceeding and be entitled to be heard." A "statute" is "[a] law passed by a legislative body." Black's Law Dictionary (7th ed.1999). The taxpayers correctly point out that § 6-6-227 does not require that the attorney general be notified of a constitutional challenge to a county ordinance; however, it appears to us that the constitutionality of Act No. 67-406 (the enabling legislation that required the inclusion of the contested exemptions in the county ordinance) was at issue from the very beginning of the action. We further note that even if a trial court decides, sua sponte, that a statute is unconstitutional, its order is void unless the attorney general was served pursuant to § 6-6-227 and was given an opportunity to be heard. See Ex parte Northport Health Service, Inc., 682 So.2d 52 (Ala.1996). We conclude, therefore, that the attorney general had to be notified of the constitutional challenge to Act No. 67-406.
[3]  The record indicates that it is customary for the Attorney General's Office to acknowledge service on the attorney general and to waive his right to further notification. Walter Turner, chief assistant attorney general, testified by affidavit as follows:

"It is ... part of my duties to maintain the civil docket containing information on all civil cases served on this office including those served on us pursuant to Section 6-6-227 Code of Alabama, 1975. It is my normal and customary practice to answer this service by an acknowledgement and waiver. This pleading informs the Court that the Attorney General has been served but does not choose to be heard by the Court on the constitutionality of the statute, ordinance, or franchise under constitutional attack."
Whether this practice on the part of the Attorney General's Office complies with the legislative intent underlying § 6-6-227 is not an issue in this present case.
