I have a problem in my article. I want to compare between two amounts having the same bet, but with different fields. I get this output:
SELECT v.bid FROM v1 v WHERE sens = 'c' GROUP BY bid HAVING Sum(mont) < (SELECT Sum(l.mont) FROM v1 l WHERE sens = 'd' AND l.bid = v.bid group by l.bid);
ERROR 1054 (42S22): Field 'v.bid is unknown in the list of fields`
Edit: V1 is a view, I used the aliases l and v, trying to translate the subquery into the main query
Sorry guys, thank you all for your answers, I had a problem with the columns of the source table, and now it is solved :)
source share