Skip to content
Advertisement

MySQL script triggers Error #1241

I have the script below, which is supposed to get a price for an array of ID’s that has been provided.

But it needs to get 1 price per ID, and the tricky part is, that I want to have the ability to have scheduled price updates.

This mean that it needs to take the price that is <= UTC_TIMESTAMP smaller or equal to the current time.

Is this possible?


Sample data: Current output

Wanted output:

Advertisement

Answer

I guess your issue is on the IN clause.

You select two field in IN clause.

EDIT

You need to self join a subquery by wo_id and Max timestamp_valid.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement