How to prompt ChatGPT for simple Python code for a LowCode, Excel like web system?

For example, I needed this
“in Python, how to get the first record of a table?”

Chat GPT created several answers that did not work, one more complicated than the next.

THIS was the formula that worked, but I got it from a forum

Ultra simple. It did not had to create functions, definitions, use third party libraries, etc.

but I can NEVER get ChatGPT to give answers like that. Any idea?