MYSQL optional parameters


I have a question about SQL how to make a column optional

like I want to display a product that has command 4 or the opposite case has all the command of course in the same request

like this example:

select * from product where id_command=4 or

select * from product

Note : id_command it is a parameter either it exists or null if it displays all the products.

submitted by /u/djokov93
[link] [comments]

Go to Source of this post
Author Of this post: /u/djokov93
Title Of post: MYSQL optional parameters
Author Link: {authorlink}