The grammars use terms such as desiderative and/or optative. מִֽי־֭יִתֵּן is basically like an interjection to introduce a sentence expressing something desired. A more literal translation is "Who will give/provide?" It's an interrogative clause, not a relative clause.
2) Desiderative/Optative (especially in the phrase מִי־יִתֵּן,
which tends to occur in poetry, particularly in the book of Job).
מִי־יִתֵּן מוּתִי אֲנִי תַחְתֶּיךָ
Would that I had died instead of you! (2 Sam 19:1); If only I had died …
מִי־יִתֵּן אֱלוֹהַּ דַּבֵּר
Would that God might speak, … (Jb 11:5)
Putnam, F. C. (2002). Hebrew Bible Insert: A Student’s Guide to the Syntax of
Biblical Hebrew (p. 12). Quakertown, PA: Stylus Publishing.
§43.3. Factual (or WH-) Questions
These questions are introduced by the following interrogatives.
In a verbal question the verb follows the interrogative. In a
nominal clause the predicate follows the question:
Sometimes a fixed expression מִי יִתֵּן is used. This construction, which acts
syntactically as an interjection, expresses a positive wish. (Cf. §45.3.)
בַּבֹּקֶר תֹּאמַר מִי־יִתֵּן עֶרֶב
In the morning you shall say: Would it were evening! (Deut. 28:67).
Van der Merwe, C., Naudé, J., Kroeze, J., Van der Merwe, C., Naudé,
J., & Kroeze, J. (1999). A Biblical Hebrew Reference Grammar
(electronic ed., p. 322-323). Sheffield: Sheffield Academic Press.
THE OPTATIVE SENTENCE
§ 135. An interrog. sent. with מִי who? expresses a wish. 2 S. 23:15 מִי יַשְׁקֵנִי מַיִם
O that I had water to drink! (lit., who will let me drink!). Ps. 4:7 מִי יַרְאֵנוּ טוֹב
O that we saw some success! Nu. 11:4, 2 S. 15:4, cf. Mal. 1:10. — Particularly
the phrase מִי יִתֵּן who will give? 2 S. 19:1 מִי יִתֵּן מוּתִי אֲנִי תַחְתֶּיךָ would that I had died
for thee! Ex. 16:3. With impf., Job 6:8 מִי יִתֵּן תָּבוֹא שֶֽׁאֱלָתִי O that my request might
come! Job 13:5; 14:13.
Rem. 1. The opt. sense of לוּ, אִם, has arisen out of the conditional use;
cf. Gen. 24:42, Ex. 32:32, where the transition is seen.
Rem. 2. A rare opt. part. is אַֽחֲלֵי, אַחְלַי (out of אח and לי = לו), 2 K. 5:3,
Ps. 119:5 (אָז in apod).
Rem. 3. The consn. of מי יתן varies. (1</?LLS nbr?>) One acc., Jud. 9:29,
Deu. 28:67, Ps. 14:7; 55:7, Job 14:4; 29:2 (suff.), 31:31, 35 (ptcp.).
(2) Two acc., Nu. 11:29, Jer. 8:23; 9:1 (verbs of granting, 2 acc. § 78,
R. 1; unless the consn. be who will set me in the wild, (in) a lodge, as
Jos. 15:19, Jud. 1:15 where ארן might be acc. of place). (3) inf. cons.
2 S. 19:1, Ex. 16:3; acc. and inf., Job 11:5 מִי יִתֵּן אֱלוֹהַּ דַּבֵּר that God would
speak (anomalous arder perhaps due to emph. on God). (4) Simple impf.,
Job 6:8; 13:5; 14:13; impf. with vav, Job 19:23; vav conv. perf., Deu. 5:26
O that this mind of theirs might be to them (always), to fear, &c. With perf.
Job 23:3 (stative v.).
Davidson, A. B. (1902). Introductory Hebrew grammar Hebrew syntax (3d ed., pp. 183–184). Edinburgh: T&T Clark.
§ 151. Desiderative Sentences.
A wish may be expressed not only by the simple imperfect (§ 107 n),
cohortative (§ 108, especially with נָא § 108 c), jussive (§ 109;
with נָא § 109 b), imperative (§ 110 a), perfect consecutive (§ 112 aa)
or by a simple noun-clause (§ 116 r, note, and § 141 g) but also in the
1. By exclamations in the form of interrogative clauses: especially
sentences with מִי followed by the imperfect as being the mood of that
which is still unfulfilled but possible, and hence also of that which
is desired, e.g. 2 S 15:4 מִֽי־יְשִׂמֵ֫נִי שֹׁפֵט who maketh me judge? i.e. O that I
were made judge! 1 S 20:10, 2 S 23:15. On the other hand, מִי with the
perfect (Gn 21:7, Nu 23:10, 1 S 26:9, Is 53:1, &c.) or participle (Ps 59:8,
Pr 24:22, &c.), rather expresses a rhetorical question, i.e. a denial,
cf. § 150 d. Especially frequent is the use of מִֽי־יִתֵּן (prop. who gives?)
to introduce all kinds of desiderative clauses (see under b).—In Mal 1:10
the desiderative clause proper is co-ordinated with an interrogative
clause, מִי גַם־בָּכֶם וְיִסְגּׄר דְּלָתַ֫יִם would that one were among you and would shut
the doors, i.e. O that one would shut the doors!
Rem. Sometimes the original sense of מִֽי־יִתֵּן is still plainly discernible,
e.g. Ju 9:29 מִֽי־יִתֵּן אֶת־הָעָם הַוֶּה בְיָדִי who gives this people into my hand?
equivalent to, O that this people were given into my hand! cf. Ps 55:7.
In these examples, however, מִֽי־יִתֵּן is still equivalent to O had I! and in
numerous other instances the idea of giving has entirely disappeared, מִֽי־יִתֵּן
having become stereotyped as a more desiderative particle (utinam). Its
construction is either—
(a) With the accusative (in accordance with its original meaning) of a
substantive, Dt 28:67 would that it were even!… morning! Ju 9:29, Ps 14:7
(537), 55:7; with an accusative and a following infinitive, Jb 11:5; with
two accusatives, Nu 11:29, Jer 8:23; with the accusative of an infinitive,
Ex 16:3, 2 S 19:1 מִֽי־יִתֵּן מוּתִי אֲנִי תַחְתֶּ֫יךָ would that I had died for thee
(for אֲנִי cf. § 135 f); of a participle, Jb 31:35; of a personal pronoun
(as a suffix), Jb 29:2 (with a following כְּ; but מִֽי־יִתְּנֵ֫נִי Is 27:4 and Jer 9:1
with a following accusative is not simply equivalent to מִֽי־יִתֵּן לִי, but is
properly who endows me with, &c.; cf. § 117 ff).—With a still greater
weakening of the original meaning מִֽי־יִתֵּן is used with an adjective in Jb 14:4
could a clean thing but come out of an unclean! i.e. how can a clean thing
come, &c.; similarly in Jb 31:31 who can find one that hath not been satisfied!
Gesenius, F. W. (1910). Gesenius’ Hebrew grammar. (E. Kautzsch & S. A. E. Cowley, Eds.) (2d English ed., pp. 476–477). Oxford: Clarendon Press.