Mysql - is it possible a view with parameters

Hi all,
sorry to bother you but it’s asked to me (my pm)
to create a view from a select like this


SELECT count(id) FROM mytable where field1 IS NOT NULL AND field2 > 1

I put 1 but it can be any other number like 3 … 1000
All in all it worth create a view for a simple query ?
Thanks in advance.
weelly

in my opinion, no

besides, a view cannot accept a runtime parameter (e.g. value for field2), so you’d have to write a stored procedure instead

:slight_smile:

:slight_smile: thanks it’s also my opinion but … ^^