私はこのテーブルを持っています:
table(fied1 int、field2 int、field3 varchar(40));
ストアドプロシージャなしで次のようなものを使用したいと思います。
declare int nr default 0;
select coalesce(max(field1),0) into nr from table where field2=? and field3=?;
if(nr = 0) then
select coalesce(max(field1),0)+1 into nr from table;
end if;
単一選択からのnrの値が必要です。plsヘルプ!!!