Daniel knew God reveals mysteries, so he asked for that (Daniel 2:28).
When God answered, even the king said, “Your God is God of gods and Lord of kings, and a revealer of mysteries (Daniel 2:47).”
If you know what God can do, you can ask Him to do it.