All who are materially interested in the subject matter should be made parties, either as plaintiffs or defendants, so that the court may grant full relief and adjust in one suit the rights of all parties interested. Revoir v. Kansas Super Motels of N. D., Inc., 224 N.W.2d 549 (N.D. 1974); Smith v. Amerada Petroleum Corporation, 136 N.W.2d 483 (N.D. 1965); Jester v. Jester, 76 N.D. 517, 37 N.W.2d 879 (1949). In National Farmers Union Prop. Cas. Co. v. Schmidt, 219 N.W.2d 111, 114 (N.D. 1974), we said:
This court has held that all parties who are materially interested in a suit or in the subject matter of an action should be made parties either as plaintiffs or as defendants, so that the court may grant full relief and adjust in one action the rights of all persons interested growing out of or connected with the subject matter of the suit. Jester v. Jester, 76 N.D. 517, 37 N.W.2d 879. The answer to the question of whether the persons who have an interest under the original lease are necessary parties is, of course, dependent upon the division of rents, royalties, and income due the various owners and transferees of portions of the land or mineral interests under the original lease with its entirety clause.
These answers, under decisions of this court, constituted counterclaims. Jester v. Jester, 76 N.D. 517, 37 N.W.2d 879; Robertson v. Brown, 75 N.D. 109, 25 N.W.2d 781; Goss v. Herman, 20 N.D. 295, 127 N.W. 78; Betts v. Signor, 7 N.D. 399, 75 N.W. 781; Power v. Bowdle, 3 N.D. 107, 54 N.W. 404, 21 LRA 328, 44 Am St Rep 511. Without further pleading, either by amendment to the complaint or by reply, the plaintiffs sought to attack the deed which the plaintiffs had given to Kaufman by offering testimony tending to show that it was obtained fraudulently by Larson who was the agent of Kaufman.
Where defendant interposes a counterclaim in asserting title in himself and asking for affirmative judgment, the court must determine and adjudicate the claims set forth in defendant's counterclaim even though plaintiff's cause of action may fail. Jester v. Jester, 76 N.D. 517, 37 N.W.2d 879. The defendant in a suit to quiet title cannot question the right of a plaintiff, unless he can show title in himself.