וַיִּתְחַתֵּ֣ן שְׁלֹמֹ֔ה אֶת־פַּרְעֹ֖ה מֶ֣לֶךְ מִצְרָ֑יִם וַיִּקַּ֣ח אֶת־בַּת־פַּרְעֹ֗ה וַיְבִיאֶ֙הָ֙ אֶל־עִ֣יר דָּוִ֔ד עַ֣ד כַּלֹּת֗וֹ לִבְנ֤וֹת אֶת־בֵּיתוֹ֙ וְאֶת־בֵּ֣ית יְהוָ֔ה וְאֶת־חוֹמַ֥ת יְרוּשָׁלִַ֖ם סָבִֽיב׃
And Solomon became allied to Pharaoh king of Egypt by marriage, and took Pharaoh’s daughter, and brought her into the city of David, until he had made an end of building his own house, and the house of the LORD, and the wall of Jerusalem round about.
Niddah
One verse says “For the Lord has chosen Zion…” (Tehillim 132:13) and another verse says “For this city has aroused My anger and My wrath since the day they built it until this day…” (Yirmiyahu 32:31) One is before Shlomo married the daughter of Pharaoh, the other is after Shlomo married the daughter of Pharaoh.