Function<\/a>\u3067\u5b9f\u73fe\u3067\u304d\u307e\u3059\u306e\u3067\u3001\u4f7f\u3044\u3069\u3053\u308d\u304c\u96e3\u3057\u3044\u3068\u3044\u3046\u5370\u8c61\u3067\u3059\u3002
\nLOOP\u3057\u306a\u304c\u3089SQL\u3092\u767a\u884c\u3057\u305f\u3044\u5834\u5408\u3050\u3089\u3044\u3057\u304b\u4f7f\u3044\u9053\u306f\u601d\u3044\u3064\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u30021SQL\u3067\u5b9f\u884c\u3059\u308b\u3068memory\u304coverflow\u3057\u305f\u306e\u3067\u3001\u982d1\u6587\u5b57\uff08\u30a4\u30cb\u30b7\u30e3\u30eb\uff09\u6bce\u306b\u30b0\u30eb\u30fc\u30d4\u30f3\u30b0\u3057\u3066LOOP\u3057\u306a\u304c\u3089SQL\u3092\u5206\u5272\u5b9f\u884c\u3059\u308b\u3088\u3046\u306a\u6642\u306b\u4f7f\u3063\u3066\u307f\u305f\u306e\u3067\u3001\u3061\u3087\u3063\u3068\u7c21\u7565\u5316\u3057\u3066\u8f09\u305b\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n-- \u5909\u6570\u5ba3\u8a00\nDECLARE initials ARRAY<STRING>;\nDECLARE initial STRING;\nDECLARE i INT64 DEFAULT 0;\n\n-- SQL\u306e\u7d50\u679c\u3092\u5909\u6570\u306b\u4ee3\u5165\nSET initials = (\n SELECT ARRAY_AGG(DISTINCT SUBSTR(name, 0, 1)) FROM mydataset.members\n);\n\n-- \u914d\u5217\u4ef6\u6570\u5206LOOP\u3057\u306a\u304c\u3089SQL\u3092\u767a\u884c\nWHILE i < ARRAY_LENGTH(initials) DO\n SET initial = initials[OFFSET(i)]; -- \u914d\u5217\u304b\u30890\u30aa\u30ea\u30b8\u30f3\u3067index\u3092\u6307\u5b9a\u3057\u3066\u5024\u3092\u53d6\u308a\u51fa\u3059\n SELECT * FROM mydataset.members WHERE SUBSTR(name, 0, 1) = initial; -- initial\u3092\u4f7f\u3063\u305f\u4f55\u304b\u306e\u51e6\u7406\n SET i = i + 1;\nEND WHILE;<\/code><\/pre>\n\u3044\u304f\u3064\u304b\u767a\u751f\u3057\u305f\u30a8\u30e9\u30fc\u3092\u8f09\u305b\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n
\n- Variable declarations are allowed only at the start of a block or script\n
\n- \u5909\u6570\u5ba3\u8a00\u306f\u30b9\u30af\u30ea\u30d7\u30c8\u3082\u3057\u304f\u306f\u30d6\u30ed\u30c3\u30af\u306e\u6700\u521d\u3067\u884c\u3046\u5fc5\u8981\u3042\u308a<\/li>\n<\/ul>\n<\/li>\n
- Query error: Cannot coerce expression ( SELECT ....) to type ARRAY\n
\n- \u914d\u5217\u306b\u914d\u5217\u4ee5\u5916\u306e\u5024\u3092\u8a2d\u5b9a\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u914d\u5217\u306b\u8a2d\u5b9a\u3059\u308b\u5834\u5408\u306fARRAY_AGG\u3059\u308b\u5fc5\u8981\u3042\u308a<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n
\u307e\u305f\u3001\u5909\u6570\u306e\u6700\u5927\u30b5\u30a4\u30ba\u306f 1 MB \u3067\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u4f7f\u7528\u3055\u308c\u308b\u3059\u3079\u3066\u306e\u5909\u6570\u306e\u6700\u5927\u30b5\u30a4\u30ba\u306f 10 MB \u3067\u3059\u3002<\/code>\u3068\u306e\u3053\u3068\u306a\u306e\u3067\u3001\u5de8\u5927\u306a\u30c6\u30fc\u30d6\u30eb\u3092\u5909\u6570\u306b\u7a81\u3063\u8fbc\u3093\u3067\u51e6\u7406\u3092\u3059\u308b\u3088\u3046\u306a\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n\u30c6\u30fc\u30d6\u30eb\u306e\u30e1\u30bf\u60c5\u5831<\/h1>\n
\u30e1\u30bf\u60c5\u5831\u306f__TABLES__<\/code>\u3068\u3044\u3046\u30c6\u30fc\u30d6\u30eb\u306b\u5165\u3063\u3066\u307e\u3059\u3002
\n\u767b\u9332\u5185\u5bb9\u306f\u9805\u76ee\u540d\u304b\u3089\u3059\u3050\u306b\u5224\u65ad\u3064\u304f\u3068\u601d\u3044\u307e\u3059\u304c\u3001type\u3060\u3051\u8aac\u660e\u3059\u308b\u30681<\/code>\u304ctable\u30672<\/code>\u304cview\u3067\u3059\u3002<\/p>\nselect * from mydataset.__TABLES__;\n\n+------------+------------+---------------+---------------+--------------------+-----------+------------+------+\n| project_id | dataset_id | table_id | creation_time | last_modified_time | row_count | size_bytes | type |\n+------------+------------+---------------+---------------+--------------------+-----------+------------+------+\n| myproject | mydataset | hoge | 1602669671355 | 1603262397431 | 1451 | 453205 | 1 |\n| myproject | mydataset | fuga | 1602669672399 | 1603262400529 | 1195 | 29768175 | 1 |\n| myproject | mydataset | piyo_veiw | 1602669667583 | 1603261487231 | 16 | 1616 | 2 |\n+------------+------------+---------------+---------------+--------------------+-----------+------------+------+<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"BigQuery\u95a2\u4fc2\u306eTips\u3092\u307e\u3068\u3081\u3066\u3044\u304d\u307e\u3059\u3002 bq\u30b3\u30de\u30f3\u30c9\u306b\u3064\u3044\u3066\u306f \u3053\u3061\u3089 \u306b\u8a18\u8f09\u3057\u3066\u307e\u3059\u3002 \u30b3\u30b9\u30c8\u306b\u3064\u3044\u3066 \u3053\u3061\u3089\u3092\u53c2\u7167\u3059\u308b\u3068\u308f\u304b\u308a\u307e\u3059\u304c\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u30b3\u30b9\u30c8\u3068\u30af\u30a8\u30ea\u30b3\u30b9\u30c8\u304c\u3042\u308a\u307e\u3059\u3002 \u30b9\u30c8\u30ec\u30fc\u30b8\u30b3\u30b9\u30c8\u306f\u3060\u3044\u305f\u3044\u60f3\u50cf\u3064\u304f\u3068\u601d\u3046\u306e\u3067\u3001\u3053\u3053\u3067\u306f\u30af\u30a8\u30ea\u30b3\u30b9\u30c8\u306b\u3064\u3044\u3066\u8a18\u8f09\u3057\u307e\u3059\u3002 \u8a8d\u8b58\u3057\u3066\u304a\u304d\u305f\u3044\u306e\u306f\u4ee5\u4e0b\u306e\uff13\u3064\u3060\u3068\u79c1\u306f\u601d\u3063\u3066\u307e\u3059\u3002 \u30b3\u30b9\u30c8\u306f\u3001\u30a2\u30af\u30bb\u30b9\u3059\u308b\u30c7\u30fc\u30bf\u91cf\uff08\u30d0\u30a4\u30c8\u6570\uff09\u3067\u6c7a\u307e\u308b \u30ab\u30e9\u30e0\u578bDB\u306a\u306e\u3067\u3001\u5fc5\u8981\u306a\u30ab\u30e9\u30e0\u306e\u30c7\u30fc\u30bf\u3060\u3051\u3092\u53d6\u5f97\u3059\u308b \u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u304c\u512a\u79c0\u306a\u306e\u3067\u3001\u6700\u7d42\u7684\u306b\u5229\u7528\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u30fb\u30ab\u30e9\u30e0\u4ee5\u5916\u306f\u51e6\u7406\u5bfe\u8c61\u306b\u306a\u3089\u306a\u3044 \u3053\u306e\u30eb\u30fc\u30eb\u3092\u5143\u306b\u8003\u3048\u308b\u3068\u3001\u3060\u3044\u305f\u3044\u30b3\u30b9\u30c8\u304c\u3069\u3046\u306a\u308b\u304b\u5206\u304b\u308a\u307e\u3059\u3002 \u5b9f\u969b\u306bbq query –dry_run\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u30c7\u30fc\u30bf\u91cf\u3092\u53b3\u5bc6\u306b\u78ba\u8a8d\u3057\u3064\u3064\u4ee5\u4e0b\u306e\u8868\u3092\u4f5c\u308a\u307e\u3057\u305f\u3002 \u9805\u76ee \u30b3\u30b9\u30c8\u3078\u306e\u5f71\u97ff \u8aac\u660e * \u5bfe\u8c61\u30c6\u30fc\u30d6\u30eb\u306e\u5168\u30ab\u30e9\u30e0\u5206\u306e\u30b3\u30b9\u30c8\u304c\u304b\u304b\u308b *\u3092\u4f7f\u3046\u3068\u305d\u306e\u30c6\u30fc\u30d6\u30eb\u306e\u5168 <\/span>Continue Reading<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[32,14],"tags":[],"_links":{"self":[{"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/posts\/354"}],"collection":[{"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/comments?post=354"}],"version-history":[{"count":0,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/posts\/354\/revisions"}],"wp:attachment":[{"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/media?parent=354"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/categories?post=354"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/tags?post=354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}