2024-11-01ãã1ã¶æéã®è¨äºä¸è¦§
â ã¯ããã« https://dk521123.hatenablog.com/entry/2023/03/02/230435 ã§ã以åããã¼ãã«æ å ±ãåå¾ããã ä»åã¯ãPostgreSQLã®çµ±è¨æ å ±ç³»ã«ã¤ãã¦ã¾ã¨ãã¦ã¿ã ç®æ¬¡ ãï¼ãpg_catalog ã¹ãã¼ã ï¼ï¼pg_statio_all_tables ï¼ï¼pg_description ãï¼ãinforâ¦
â ã¯ããã« ã¹ãã¢ãã®ä¾å¤å¦çã«ã¤ãã¦æ±ã ç®æ¬¡ ãï¼ãã¹ãã¢ã ã® ä¾å¤ãã³ããªã³ã° ï¼ï¼æ§æ ãï¼ãã¹ãã¢ã ã® ä¾å¤ã¹ãã¼ ï¼ï¼æ§æ ãï¼ãã«ã¹ã¿ã ä¾å¤ãä½æãã ï¼ï¼æ§æ ãï¼ããµã³ãã« ä¾ï¼ï¼Hello world ä¾ï¼ï¼ç¬èªä¾å¤ ãï¼ãã¹ãã¢ã ã® ä¾å¤ãâ¦
â ã¯ããã« ã¹ãã¢ãã®æ¡ä»¶åå²ã«ã¤ãã¦æ±ã ç®æ¬¡ ãï¼ãIF ãï¼ããµã³ãã« ä¾ï¼ï¼Hello World ãï¼ãIF IF ãæ¡ä»¶ï¼ã THEN -- ELSEIF ãæ¡ä»¶ï¼ã THEN -- ELSE -- END IF; PostgreSQL https://www.postgresql.jp/document/7.2/programmer/plpgsql-control-â¦
â ã¯ããã« ä»åã¯ãRedshiftã® ã¹ãã¢ã ããã·ã¼ã¸ã£ (Stored Procedure) ã 解æããªãã¦ã¯ãªããªããªããè²ã ã¨ç¥ãããã¨ããã£ãã®ã§ã¡ã¢ãã¦ãã ï¼Redshiftã ã¨æå ã§å¼ããªãã®ã§ã代ããã«PostgreSQLã使ã£ãï¼ SQL Fiddle https://www.db-fiddle.â¦
â ã¯ããã« æ¥åã§ãPostgreSQL / Snowflake ã«ãã㦠REGEXP_SUBSTR ã REGEXP_REPLACE ã§ã¦ããã®ã§ 調ã¹ã¦ãå¾ã ã«ã§ã¯ãããã¾ã¨ãã¦ããã ãªãããµã³ãã«ã¯ãPostgreSQL17ã§è©¦ããã SQL Fiddle https://www.db-fiddle.com/ ç®æ¬¡ ãï¼ãæ£è¦è¡¨ç¾é¢æ° â¦
â ã¯ããã« å°ãã¿ã SQLã®ãã¼ãã«èª¿æ»ããã¦ãã¦ã 大æå / å°æåãå«ã¾ãã¦ãããå¤å®ããå¿ è¦ããã£ãã®ã§ã¡ã¢ã ãï¼ã大æå / å°æåãå«ã¾ãã¦ãããå¤å®ããã«ã¯ [1] 大æåãå«ã¾ãã¦ããããå¤å® ⦠WHERE ã対象é ç®ã != LOWER(ã対象é ç®ã);â¦