mysql update valuye code example
Example 1: mysql only_full_group_by
SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
Example 2: postgresql create trigger update timestamp
CREATE OR REPLACE FUNCTION public.set_current_timestamp_updated_at()
RETURNS trigger
LANGUAGE plpgsql
AS $function$
DECLARE
_new record;
BEGIN
_new := NEW;
_new."updated_at" = NOW();
RETURN _new;
END;
$function$
CREATE TRIGGER set_updated_at
BEFORE UPDATE ON your_table
FOR EACH ROW
EXECUTE FUNCTION set_current_timestamp_updated_at();