ここでは、両方のhair_colorを作成しました およびeye_color オプション。 (言語に相当するNULLを渡します。)
SELECT * from users where
($1 is null or hair_color = $1) and
($2 is null or eye_color = $2);
ここでは、両方のhair_colorを作成しました およびeye_color オプション。 (言語に相当するNULLを渡します。)
SELECT * from users where
($1 is null or hair_color = $1) and
($2 is null or eye_color = $2);