Reputation: 1551
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.
Upvotes: 1
Views: 139
Reputation: 3801
you have to specify multiple arguments as tuple, eg:
sql = query % (item, day)
Upvotes: 1