— The main causes of demurrer, consisting of several distinct, assignments varying in phraseology, may be condensed as follows: First, that complainants have a full and adequate remedy at law, and that the bill, being founded on an alleged breach of contract for which they seek to recover damages, avers no facts authorizing a court of equity to entertain it on the ground of discovery; second, that the bill, being for discovery and relief, avers no'facts showing that the discovery is necessary to prove any facts upon which complainants rely for relief, or that they can not otherwise prove each and every matter sought lo be discovered.
The primary and ultimate purpose of the bill is the recovery of damages for the breach of a contract, by which defendants agreed to guarantee to complainants the exclusive sale of all coal mined by defendant, or under its control from July 1, 1887, to July 1, 1888, and to furnish complainants, at the ruling market prices, such coal as may be necessary to supply their demands. The bill alleges that defendant operated and controlled several different mines, a majority of those situated in Walker county then being mined; and prays for an account of the quantity mined, the ruling market prices at each mine, and the profits which complainant would have realized had the contract been performed on the part of the defendant.
As a general proposition, courts of equity do not entertain suits the sole object of which is to recover damages for the breach of a contract, the remedy at law being adequate and complete. It is well settled, that when there is no fiduciary relation between the parties devolving the duty to render an account, and the accounts are not mutual, equity has not *544original and independent jurisdiction in the matter of accounts, unless there is so great complexity and intricacy that a jury can not examine and state it with the necessary accuracy. — State v. Bradshaw, 60 Ala. 239; Hudson v. Vaughan, 59 Ala. 609.
The ascertainment of the profits which would have been realized by complainants involves the quantity of coal mined and controlled by defendant at the different mines, the market prices at each, and the cost and expense of transportation and sale in the different markets; but these data being ascertained, the profits become a matter of mere addition and subtraction, the only difficulty consisting in the number of items. In Dickinson v. Goldthwaite, 34 Ala. 638, the account involved the manufacture and furnishing of large 'quantities of articles of clothing during a series of years, from three different places, at a profit of a designated per cent, on the original cost. It is said: “The account was for clothes furnished to the complainant during a series of years, and differs from the ordinary accounts of merchants in this, that the charging was controlled by a contract made at the inception of the account. There was no mutuality of accounts. On the complainant’s side there was only a claim of credits for payments made. . . . There was nothing more, therefore, than an account on one side, with credits for payments made. Of such an account chancery has not original and independent jurisdiction.” And while it was said' that equity will entertain jurisdiction in some cases where there is no mutuality, it was held that the account did not present that strong case of entanglement or complication which is necessary to maintain the equitable jurisdiction. The averments in the present bill, though showing difficulty in establishing the necessary data from which to state the account, do not show any greater complexity.
But the bill is framed for discovery, as well as for relief; and notwithstanding the accounts may be on one side only, and there may be no great complication, when a discovery is needed in aid of the account, and is obtained, the court will entertain jurisdiction for the purpose of final relief. Discovery itself is an acknowledged independent source of equitable jurisdiction, but the jurisdiction is auxiliary, and a suit for that purpose must be limited to the legitimate functions of furnishing evidence in aid of a pending or anticipated action. The pendency of such action, or its anticipation, and that the discovery will be material to support the plaintiff’s cause of action, or the defendant’s defense, as the case may be, must be averred. The bill is not framed, and can not be treated, as1 a bill for discovery merely. It invokes exercise of the jurisdiction of a court of equity which necessitates a hearing and de*545cree on the rights of the parties. This constitutes it a suit for relief, and liable to all the incidents of that proceeding. Story Eq. FI. § 314. Therefore, the question, whether the bill is demurrable on any of the grounds assigned, must be determined by the rules and modes of procedure peculiar to bills for discovery and relief.
The general rule is, that when equitable jurisdiction attaches for a rightful purpose, the court will retain it, and proceed to settle and adjudicate all the matters in controversy, granting complete relief, though it may involve the adjudication of purely legal questions. As a corollary from this rule, many courts hold, that when jurisdiction is acquired in a suit [having the direct and primary purpose of discovery proper, the court will proceed to grant whatever relief the complainant may be entitled to, though the matter involved is not independently within the equitable jurisdiction, and the remedy at law is adequate. In such cases, the retention of jurisdiction for the purposes of final relief is consequential, and has no foundation on which to rest, when the primary and principal ground of jurisdiction fails. That honored and most learned jurist, Chief-Justice Marshall, stated the rule in the following broad terms: “That if certain facts, essential to the merits of a claim purely legal, be exclusively within the knowledge of the party against whom that claim is asserted, he maybe required, in a court of chancery, to disclose those facts; and the court, being thus rightly in possession of the cause, will proceed to determine the whole matter in controversy.” This statement was qualified by the observation, that the rule can not be employed as a mere pretext for bringing causes, proper for a court of law, into a court of equity; and if no discovery is obtained, the suit should be dismissed, though the complainant may support his claim by evidence unaided by the answer of the defendant. — Russell v. Clark, 7 Cr. 69. This statement of the rule has been sometimes regarded as calculated to mislead in many cases by its generality.
While th'e foregoing has been distinctively called the American doctrine, the best considered cases do not regard discovery as the independent source of equitable jurisdiction to grant relief, in respect to- a matter of purely legal cognizance, in a suit for discovery and relief. In such suit, the discovery is incidental, and may be the occasion for the exercise of the jurisdiction. In such cases, when the jurisdiction does not otherwise exist, it rests on the inadequacy of the legal remedies, produced generally by the operation of the rules governing the examination of witnesses and the production of books, writings, or other evidence in courts of law. This results from *546the limitations and restrictions upon the operation of the general rule which have been well established in suits for discovery and relief. The most material limitation is, it is necessary where the complainant “seeks to transfer a cause appropriately of legal cognizance into the forum of equity for trial upon the ground of seeking discovery and that alone, to allege in his bill, and verify by affidavit, that he has no other means of proving his case.” — 1 Story Eq. Jur., § 740. Says Mr. Pomeroy: “The so-called American doctrine concerning the effect of discovery upon the equitable jurisdiction is thus-practically as follows: Whenever in a controversy purely legal, depending upon legal interests and primary rights of the plaintiff, and seeking to obtain final reliefs which are wholly legal, the plaintiff prays for a discovery as a preliminary relief, and alleges and proves that such discovery is absolutely essential to the maintenance of his contention — that he is utterably unable to establish the issues on his part by testimony of witnesses, or by any other kind of evidence admissible in courts of law — so that an action at law is utterly impracticable; then the court of equity, having jurisdiction of such a case to compel a discovery, acquires a jurisdiction over it for all purposes, and may go on and determine all the issues, and decree full and final relief, although the relief so given is of the same kind as that granted by the courts of law in similar controversies,” the defendant making actual discovery by his answer. In Cont. Life Ins. Co. v. Webb, 54 Ala. 688, it is said: “But, if the bill is framed for discovery and relief, and seeks to withdraw from the jurisdiction of courts of law matters of pure legal cognizance, it must be shown the discovery is indispensable to the ends of justice, and because of the inability of the court of law to compel it, the jurisdiction of a court of equity arises, as it arises generally because of the inadequacy of legal remedies.” The same rule has been declared in the following cases: Shackelford v. Bankhead, 72 Ala. 476; Handley v. Heflin, 84 Ala. 600.
It was also held in these cases that this well established jurisdiction of chancery is not affected by the statutory provisions authorizing the examination of parties as witnesses in courts of law. It follows from these limitations and restrictions upon the general. rule referred to above, that the source of the equitable jurisdiction in matters of legal cognizance arises from the inadeq uacy of the legal remedies, such inadequacy growing out of the necessity of a discovery to effectuate the ends of justice.
Appellant, however, insists that the bill does not aver that complainants are unable to prove the facts upon which they *547rely for final relief, otherwise than by the answer of defendant; but, on the contrary, shows they can be proved otherwise. The averments of the bill are, “that defendant has refused to account to complainants for anything, or as to the coal mined or controlled by them, and that to learn with anything like accuracy the amounts of coal mined by them a discovery from them through their officers, books and agents, is absolutely necessary;” also, “complainants are advised, that by reason of the fact that all the data and information necessary to fix the amounts which defendant should pay to complainants rest peculiarly in the knowledge of defendant, and can not be ascertained except by discovery from defendant of the amount of coal mined or controlled by them, the costs of mining the same, and the ruling prices thereof, they have no full and adequate remedy at law.”
There is no contention as to the materiality of the facts. Discovery is sought, not only from the officers and agents, but also from the books of the corporation. It is impracticable for the officers or agents to state with necessary accuracy, without reference to the books, the amount of coal mined at séveral different mines, and the ruling prices, through a year. By our practice and rulings, an officer or agent can not be compelled to produce the books of a corporation in a court of law; but their production may be compelled by a court of equity. The bill alleges that the facts rest peculiarly within the knowledge of defendant, and that a discovery is absolutely necessary to ascertain them. These allegations satisfactorily show that the facts can not be otherwise proved than by discovery. The bill sufficiently avers the inadequacy of the remedy at law, occasioned by the necessity of discovery, as preliminary relief. — Handley v. Heflin, supra.
A corporation can not make answer on oath; hence, when a discovery is sought from it, the officer from whom the discovery may be obtained by answer under oath, may, and should be, made a co-defendant; for, if he is not a party, the court is powerless to compel him to answer. The want of such party, however, is not assigned as cause of demurrer. 1 Pom. Eq. Jur., § 199.
Affirmed.