1

In order to select the price of an item I have the following code:

product = ['user_input']
item(product)
day = int(self.ui.spinBox.value())

query = 'select price from (select * from %s order by count limit %d) order by count as limit desc'

sql = query % item % day

In response I get the error that there aren't enough input arguments.

1 Answer 1

1

you have to specify multiple arguments as tuple, eg:

sql = query % (item, day)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.