並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 40 件 / 56件

新着順 人気順

sql select duplicate valuesの検索結果1 - 40 件 / 56件

  • 履歴テーブルから最新の1件を取ってくる方法 - そーだいなるらくがき帳

    例えば次のようなテーブルがあったとする。 -- PostgreSQL CREATE TABLE history ( id SERIAL PRIMARY KEY, user_id INTEGER NOT NULL, data TEXT, created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ); -- MySQL CREATE TABLE history ( id INT AUTO_INCREMENT PRIMARY KEY, user_id INT NOT NULL, data TEXT, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ); INSERT INTO history (user_id, data, created_at) VALUES (1, 'First

      履歴テーブルから最新の1件を取ってくる方法 - そーだいなるらくがき帳
    • ルールは現場で死にました - The Rules of Programming の読書感想文 - じゃあ、おうちで学べる

      本日は人生の数ある選択肢のなかから、こちらのブログを読むという行動を選んでくださいまして、まことにありがとうございます。 はじめに 正直に言えば、プログラミングのルール本には懐疑的だった。「Clean Code」も「Effective Java」も読んだ。読んだが、現場でそのまま使えたことは少ない。コンテキストが違う。チームが違う。言語が違う。ルールは理想であり、現実は常に例外だ。 そう思っていた。本書を読むまでは。 Chris Zimmerman氏の「The Rules of Programming」(邦題:ルールズ・オブ・プログラミング ―より良いコードを書くための21のルール)は、私の予想を裏切った。これは「ルールを守れ」という本ではない。「ルールの本質を理解し、現場に合わせて判断しろ」という本だ。著者自身が、読者にこれらのアプローチを鵜呑みにするなと言っている。この謙虚さが、逆にこ

        ルールは現場で死にました - The Rules of Programming の読書感想文 - じゃあ、おうちで学べる
      • What's New In DevTools (Chrome 96)  |  Blog  |  Chrome for Developers

        Preview feature: New CSS Overview panel Use the new CSS Overview panel to identify potential CSS improvements on your page. Open the CSS Overview panel, then click on Capture overview to generate a report of your page’s CSS. You can further drill down on the information. For example, click on a color in the Colors section to view the list of elements that apply the same color. Click on an element

        • ISUCON12 予選の解説 (Node.jsでSQLiteのまま10万点行く方法) : ISUCON公式Blog

          ISUCONとはLINEヤフー株式会社が運営窓口となって開催している、お題となるWebサービスを決められたレギュレーションの中で限界まで高速化を図るチューニングバトルです ISUCON12 予選の解説 (Node.jsでSQLiteのまま10万点行く方法) こんにちは、面白法人カヤックのacidlemonです。例年ISUCONに参加するたびにとても長い「やったこと」ブログを書いているので、もしかしたらそちらを読んだことがある人もいるかもしれません。 ISUCONの公式サイトに記事を書くのは ISUCON3の予選の解説 以来でしょうか。今回もacidlemonが解説、fujiwaraが講評を書く予定ですので、お楽しみに。あ、そういえば先日掲載していただいた 面白法人カヤックからの応援メッセージ の脳内インタビューも私が書いていますのでよく考えたらそれ以来ということになるのかもしれません。予選

            ISUCON12 予選の解説 (Node.jsでSQLiteのまま10万点行く方法) : ISUCON公式Blog
          • Software Design 2024年8月号 連載「レガシーシステム攻略のプロセス」第4回 ZOZOTOWNリプレイスにおけるマスタDBの移行 - ZOZO TECH BLOG

            はじめに 技術評論社様より発刊されているSoftware Designの2024年5月号より「レガシーシステム攻略のプロセス」と題した全8回の連載が始まりました。 ZOZOTOWNリプレイスプロジェクトで採用したマイクロサービス化のアプローチでは、安全かつ整合性のとれたデータ移行が必須となりました。第4回では、このマスタDBの移行について紹介します。 目次 はじめに 目次 はじめに マスタDB移行 マスタDB移行について 要件と課題 テーブル構成を再設計したうえでデータ移行を実施する ダウンタイムなしでデータ移行を実施する 方針 異なるDBおよびデータスキーマ間で移行を実施するためEmbulkを使用する ダブルライトをリリースし、データ移行中に発生するDBへの書き込みを両DBにアトミックに実施する データを一時DBに格納し、一時DBから移行先DBにデータを移行する BulkloadとBac

              Software Design 2024年8月号 連載「レガシーシステム攻略のプロセス」第4回 ZOZOTOWNリプレイスにおけるマスタDBの移行 - ZOZO TECH BLOG
            • What's New In DevTools (Chrome 94)  |  Blog  |  Chrome for Developers

              Use DevTools in your preferred language Chrome DevTools now supports more than 80 languages, allowing you to work in your preferred language! Open Settings, then select your preferred language under the Preferences > Language dropdown and reload DevTools. Preferences" width="800" height="494"> Chromium issue: 1163928 New Nest Hub devices in the Device list You can now simulate the dimensions of Ne

              • What's New In DevTools (Chrome 95)  |  Blog  |  Chrome for Developers

                New CSS length authoring tools DevTools added an easier yet flexible way to update lengths in CSS! In the Styles pane, look for any CSS property with length (e.g. height, padding). Hover over the unit type, and notice the unit type is underlined. Click on it to select a unit type from the dropdown. Hover over the unit value, and your mouse pointer is changed to horizontal cursor. Drag horizontally

                • ISUCON12予選参加記 Rustで予選突破した

                  2022年7月23日(土) に開催された ISUCON 12 に Rust で参加して20位で予選突破しました。 チーム チームO omu: https://omuric.github.io/posts/isucon12-qualify/ dice801: https://zenn.dev/dice801/articles/760f8fc6af5a08 daiju (自分) 事前準備 基本的には前年までに用意したツールを活用する cargo-make で3台の EC2 への deploy や再起動やログの集計をコマンド一発で実行可能にする isuconf で現地と手元の設定ファイルの同期 omu の自作コマンド どちらも年に1回しか登場しないので、事前の練習でコマンドを手に馴染ませておく。 Rust のためのトレースツールの整備 https://github.com/hinohi/rust

                    ISUCON12予選参加記 Rustで予選突破した
                  • Introduction to Postgres Indexes – Frontend Masters Blog

                    This Part 1 (of a 2-part series) is a practical, hands-on, applicable approach to database indexes. We’ll cover what B Trees are with a focus on deeply understanding, and internalizing how they store data on disk, and how your database uses them to speed up queries. This will set us up nicely for part 2, where we’ll explore some interesting, counterintuitive ways to press indexes into service to a

                      Introduction to Postgres Indexes – Frontend Masters Blog
                    • What's New In DevTools (Chrome 100)  |  Blog  |  Chrome for Developers

                      Chrome 100 Here’s to the 100th Chrome version! Chrome DevTools will continue to provide reliable tools for developers to build on the web. Take a moment to click around in the What’s New tab to celebrate the milestones. As usual, you can watch the latest What’s New in DevTools video by clicking on the image. View and edit @supports at rules in the Styles pane You can now view and edit the CSS @sup

                      • What happened to Vivaldi Social? | Thomas Pike’s other blog

                        On Saturday 8 July 2023, user accounts started disappearing from the Vivaldi Social Mastodon instance. What was going on, how did this happen, and what were the consequences? This is a very long blog post, but to be fair, this was also to be a very long weekend. If you want to skip to the conclusion, there’s a TL;DR (too long; didn’t read) section at the end. Something’s not right It was around 17

                          What happened to Vivaldi Social? | Thomas Pike’s other blog
                        • 【データ基盤構築/AWS Lambda】Pythonを使ってSnowflakeのデータをRDSにinsertする - Qiita

                          import sys import json import boto3 import ast import os import snowflake.connector import pymysql from snowflake.connector import DictCursor from sqlalchemy import create_engine from sqlalchemy.sql import text from datetime import datetime def lambda_handler(event, context): # 今日の日付とSQLを実行する日時を変数で用意 today = datetime.now() updated_at_str = datetime.strftime(today, '%Y-%m-%d %H:%M:%S') ## Snowflake

                            【データ基盤構築/AWS Lambda】Pythonを使ってSnowflakeのデータをRDSにinsertする - Qiita
                          • RedshiftのMERGE SQL commandがGAになりましたね。 - KAYAC Engineers' Blog

                            SREチームの池田です。 今回はAmazon RedshiftのMERGE SQL commandがGAになりましたので、MERGE SQL commandの何が嬉しいのかを話をしたいと思います。 SRE連載 4月号になります。 aws.amazon.com 3行でまとめ RedshiftのMERGE SQL commandがGAになりました。 Bulk UpsertをSQL1文で実行できるものです。 以前と比べるとスッキリします。 複数のデータソースから算出されるレポートの更新に使うと嬉しい。 以前のRedshiftにおけるBulk Upsertについて ご存知かもしれませんが、『なかったらInsert、あったらUpdate』を通称Upsertといいます。 Redshiftにおける、Upsertのやり方ですがMERGE SQL commandが出る前のRedshiftでは以下のドキュメン

                              RedshiftのMERGE SQL commandがGAになりましたね。 - KAYAC Engineers' Blog
                            • Unconventional PostgreSQL Optimizations

                              When it comes to database optimization, developers often reach for the same old tools: rewrite the query slightly differently, slap an index on a column, denormalize, analyze, vacuum, cluster, repeat. Conventional techniques are effective, but sometimes being creative can really pay off! In this article, I present unconventional optimization techniques in PostgreSQL. image by abstrakt design Table

                                Unconventional PostgreSQL Optimizations
                              • Real-world gen AI use cases from the world's leading organizations | Google Cloud Blog

                                AI is here, AI is everywhere: Top companies, governments, researchers, and startups are already enhancing their work with Google's AI solutions. Published April 12, 2024; last updated October 9, 2025. Automotive & Logistics Business & Professional Services Financial Services Healthcare & Life Sciences Hospitality & Travel Manufacturing, Industrial & Electronics Media, Marketing & Gaming Public Sec

                                  Real-world gen AI use cases from the world's leading organizations | Google Cloud Blog
                                • What's New in DevTools (Chrome 117)  |  Blog  |  Chrome for Developers

                                  Network panel improvements Override web content locally even faster The local overrides feature is now streamlined, so you can easily mock response headers and web content of remote resources from the Network panel without access to them. To override web content, open the Network panel, right-click a request, and select Override content. If you have local overrides set up but disabled, DevTools en

                                    What's New in DevTools (Chrome 117)  |  Blog  |  Chrome for Developers
                                  • What's New In DevTools (Chrome 92)  |  Blog  |  Chrome for Developers

                                    CSS grid editor A highly requested feature. You can now preview and author CSS Grid with the new CSS Grid editor! When an HTML element on your page has display: grid or display: inline-grid applied to it, you can see an icon appear next to it in the Styles pane. Click the icon to toggle the CSS grid editor. Here you can preview the potential changes with the on screen icons (e.g. justify-content:

                                    • Lesser Known PostgreSQL Features

                                      In 2006 Microsoft conducted a customer survey to find what new features users want in new versions of Microsoft Office. To their surprise, more than 90% of what users asked for already existed, they just didn't know about it. To address the "discoverability" issue, they came up with the "Ribbon UI" that we know from Microsoft Office products today. Office is not unique in this sense. Most of us ar

                                        Lesser Known PostgreSQL Features
                                      • What's New in DevTools (Chrome 113)  |  Blog  |  Chrome for Developers

                                        Override network response headers You can now override response headers in the Network panel. Previously, you needed access to the web server to experiment with HTTP response headers. With response header overrides, you can locally prototype fixes for various headers, including but not limited to: Cross-Origin Resource Sharing (CORS) Headers Permissions-Policy Headers Cross-Origin Isolation Header

                                          What's New in DevTools (Chrome 113)  |  Blog  |  Chrome for Developers
                                        • MySQLで「無ければINSERT、あればUPDATE」を実現する方法 - Mobile Factory Tech Blog

                                          こんにちは、駅奪取エンジニアの id:kimkim0106(旧: id:kaoru_k_0106)です。 今回の記事は、駅奪取でテーブルにレコードが「無ければ INSERT、あれば UPDATE」(いわゆる UPSERT)をする箇所で Duplicate entry が出ていたのを修正したり、未然に防ぐ実装をしたときに得られた知見です。 このような処理はよく使われますが、うまく実装しないとエラーが発生したりパフォーマンスの問題が生じたりします。 この記事では、自分が試した方法のメリット・デメリットについて説明します。 目次 前提条件 Duplicate entry とは 1. Duplicate entry が出たらトランザクション自体をやり直す 2. INSERT ... ON DUPLICATE KEY UPDATE 3. とりあえず INSERT して Duplicate entry

                                            MySQLで「無ければINSERT、あればUPDATE」を実現する方法 - Mobile Factory Tech Blog
                                          • PostgreSQL 18の新機能、仮想生成列の使い方や制約、格納生成列との使い分けについて | フューチャー技術ブログ

                                            PostgreSQL 18連載の3本目です。 PostgreSQL 18がリリースされ、仮想生成列についてまとめます。PostgreSQLで従来から利用できた格納生成列や、生成列自体と合わせて紹介します。 生成列生成列は他の列から計算される列のことで、テーブルに対するビューをつくるように、ある列に対してビューのような列を作ることができます。ビューにも、MViewと通常のViewがあるように、生成列も「格納生成列」と「仮想生成列」の2種類があります。格納生成列は、登録/更新時に計算されて物理的にストレージが割り当てられます(MVIEWに似ています)。仮想列は列が読み取られる時に動的に計算されます(Viewに似ています)。 PostgreSQL 12で「格納」生成列が利用可能となり、今回18から「仮想」生成列が利用可能となりました。ここまで説明した内容をざっと、表でまとめました。 特徴格納生成

                                              PostgreSQL 18の新機能、仮想生成列の使い方や制約、格納生成列との使い分けについて | フューチャー技術ブログ
                                            • What's New In DevTools (Chrome 98)  |  Blog  |  Chrome for Developers

                                              Preview feature: Full-page accessibility tree The new Full-page accessibility tree makes it easier for you to get an overview of the full-page accessibility tree and help you better understand how your web content is exposed to assistive technology. In the Elements panel, open the Accessibility pane and select Enable full-page accessibility tree checkbox. Then, reload DevTools and you will see a n

                                              • iOS Hacking - A Beginner’s Guide to Hacking iOS Apps [2022 Edition]

                                                My first post will be about iOS Hacking, a topic I’m currently working on, so this will be a kind of gathering of all information I have found in my research. It must be noted that I won’t be using any MacOS tools, since the computer used for this task will be a Linux host, specifically a Debian-based distribution, in this case, Kali Linux. I will also be using ‘checkra1n’ for the device jailbreak

                                                • What's New In DevTools (Chrome 93)  |  Blog  |  Chrome for Developers

                                                  Editable CSS container queries in the Styles pane You can now view and edit CSS container queries in the Styles pane. Container queries provide a much more dynamic approach to responsive design. The @container at-rule works in a similar way to a media query with @media. However, instead of querying the viewport and user agent for information, @container queries the ancestor container that matches

                                                  • What's New in Emacs 28.1?

                                                    Try Mastering Emacs for free! Are you struggling with the basics? Have you mastered movement and editing yet? When you have read Mastering Emacs you will understand Emacs. It’s that time again: there’s a new major version of Emacs and, with it, a treasure trove of new features and changes. Notable features include the formal inclusion of native compilation, a technique that will greatly speed up y

                                                    • dbt Incremental Cookbook

                                                      Incremental models are one of the most powerful features of dbt. Let’s review common patterns for implementing incrementals. OverviewIncremental models are a dbt feature that allows us to manage large tables by adding subsets of data. dbt Query Pattern In dbt, we write templates that generate SQL.We use Jinja macros to declaratively generate our SQL queries. These macros output text and are identi

                                                        dbt Incremental Cookbook
                                                      • データマートをセルフサービス化したら1石4鳥だった話|littlekbt

                                                        こんにちは、noteで数少ないデータエンジニアの久保田です。 この記事はnote株式会社 Advent Calendar 2022の24日目の記事です。 さて、早速ですが皆さん、データマート作っていますか? データマートの作成は結構大変なことが多いので、ここ最近の弊社の取り込みを紹介させてください。 データマートデータマートとは、使用用途に合わせた集計済みのテーブル群とここでは定義します。 弊社では、note内でのユーザーの行動ログやユーザーが書いた記事など、多様なデータが色々なデータソースにあります。 それらをデータウェアハウスである Snowflake に入れて、Snowflakeのみで分析やアプリケーション、機械学習に使えるように整備しています。 しかし、このままでは欲しいデータがどこにあるのかわからない、という状態になってしまっています。 データウェアハウスは倉庫で、データマートは

                                                          データマートをセルフサービス化したら1石4鳥だった話|littlekbt
                                                        • 第191回 MySQLでUPSERT処理を実現する | gihyo.jp

                                                          皆さんは、UPSERT処理という言葉をご存知でしょうか。UPDATEとINSERTを合わせた言葉で、INSERTをする際に、すでにそのデータが存在していない場合はINSERTを行って、その行がある場合はUPDATEを行うという処理になります。 今回は、MySQLでUPSERT処理を実現する方法を紹介していきたいと思います。 検証環境 今回はdockerで建てたMySQLを使用します。以下のコマンドでdockerを建ててローカルからアクセスをします。 % docker run --platform linux/x86_64 -p 3307:3306 -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:latest アクセス方法は以下の通りになります。 % mysql -uroot -pmy-secret-pw -h127.0.0.1 -P3307 執筆時

                                                            第191回 MySQLでUPSERT処理を実現する | gihyo.jp
                                                          • Does OLAP need an ORM?

                                                            TL;DR · ORMs have proven to be useful for many developers in the OLTP/transactional stack (Postgres, MySQL, etc). · OLAP/analytical databases like ClickHouse could potentially benefit from ORM abstractions. · Existing transactional ORMs probably shouldn’t be extended to OLAP due to fundamental differences in semantic meaning between OLTP and OLAP. · Moose OLAP (part of MooseStack) is an open sourc

                                                              Does OLAP need an ORM?
                                                            • What's New in DevTools (Chrome 118)  |  Blog  |  Chrome for Developers

                                                              New section for custom properties in Elements > Styles The Elements panel now supports the @property CSS at-rule. It lets you define CSS custom properties explicitly and register them in a stylesheet without running any JavaScript. To inspect your registered custom properties, in Elements > Styles, hover over the property name and see its descriptors in a tooltip. In the tooltip, click the link to

                                                                What's New in DevTools (Chrome 118)  |  Blog  |  Chrome for Developers
                                                              • What's New in DevTools (Chrome 111)  |  Blog  |  Chrome for Developers

                                                                Debugging HD color with the Styles pane New CSS color types and spaces are coming to the web! It is equally exciting that DevTools introduced new tools to help developers create, convert and debug High Definition color. The Styles pane now supports 12 new color spaces and 7 new gamuts as outlined in the CSS Color Level 4 specification. See High Definition CSS Color Guide for a comprehensive unders

                                                                  What's New in DevTools (Chrome 111)  |  Blog  |  Chrome for Developers
                                                                • Handling Concurrency Without Locks

                                                                  Concurrency is not very intuitive. You need to train your brain to consider what happens when multiple processes execute a certain code block at the same time. There are several issues I often encounter: Failing to recognize potential concurrency issues: It's not uncommon for both beginner and seasoned developers to completely miss a potential concurrency problem. When this happens, and the concur

                                                                  • Horizontally scaling the Rails backend of Shop app with Vitess - Shopify

                                                                    Horizontally scaling the Rails backend of Shop app with VitessShop app horizontally scaled a Ruby on Rails app with Vitess. This blog describes Vitess and our detailed approach for introducing Vitess to a Rails app. Good problems We experienced hockey stick growth after we launched the Shop app. We were glued to our dashboards and saw millions of users onboard onto the app. This was gratifying, bu

                                                                      Horizontally scaling the Rails backend of Shop app with Vitess - Shopify
                                                                    • What's New In DevTools (Chrome 101)  |  Blog  |  Chrome for Developers

                                                                      Import and export recorded user flows as a JSON file The Recorder panel now supports importing and exporting user flow recordings as a JSON file. This addition makes it easier to share user flows and can be useful for bug reporting. For example, download this JSON file. You can import it with the import button and replay the user flow. Apart from that, you can export the recording as well. After r

                                                                      • pt-online-schema-changeとgh-ostの比較(データが損失するかもしれないAlterTable編) - kenken0807_DBメモ

                                                                        こちらのエントリーは MySQL Advent Calendar 2021の14日目の記事になります。 今年はオンラインスキーママイグレーションツールのpt-online-schema-change(pt-osc)とgh-ostをよく調べていたので、その中から一つ。 mysqlコマンドではエラーになるけど、制約違反などでデータが損失する可能性のあるAlter Tableを実施するとそれぞれどうなるか比較したいと思います。 昨今ではMySQL8.0からのInstance Alter Tableが使えるのであれば、まずこれを使うでしょう。 それ以外だとOnlineDDL機能を使ってスキーマ変更するでしょうけど、これはレプリカの遅延が発生するため、pt-oscや gh-ostを使う機会はまだ多いと感じます。 各種ツールについて詳しく説明はしません。 gh-ostについてはがんばって書いた記事があ

                                                                          pt-online-schema-changeとgh-ostの比較(データが損失するかもしれないAlterTable編) - kenken0807_DBメモ
                                                                        • What's New In DevTools (Chrome 99)  |  Blog  |  Chrome for Developers

                                                                          Throttling WebSocket requests The Network panel now supports throttling web socket requests. Previously, the network throttling didn't work on web socket requests. Open the Network panel, click on a web socket request and open the Messages tab to observe the message transfers. Select Slow 3G to throttle the speed. Chromium issue: 423246 New Reporting API pane in the Application panel Use the new R

                                                                          • GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning

                                                                            Accepted at ICLR 2026 (Oral). GEPA: REFLECTIVE PROMPT EVOLUTION CAN OUTPER- FORM REINFORCEMENT LEARNING Lakshya A Agrawal1 , Shangyin Tan1 , Dilara Soylu2 , Noah Ziems4 , Rishi Khare1 , Krista Opsahl-Ong5 , Arnav Singhvi2,5 , Herumb Shandilya2 , Michael J Ryan2 , Meng Jiang4 , Christopher Potts2 , Koushik Sen1 , Alexandros G. Dimakis1,3 , Ion Stoica1 , Dan Klein1 , Matei Zaharia1,5 , Omar Khattab6

                                                                            • What's New In DevTools (Chrome 97)  |  Blog  |  Chrome for Developers

                                                                              Preview feature: New Recorder panel Use the new Recorder panel to record, replay and measure user flows. Open the Recorder panel. Follow the instructions on screen to start a new recording. For example, you can record the coffee checkout process with this coffee ordering demo application. After adding a coffee and filling out payment details, you can end the recording, replay the process or click

                                                                              • What's New In DevTools (Chrome 107)  |  Blog  |  Chrome for Developers

                                                                                Customize keyboard shortcuts in DevTools You can now customize keyboard shortcuts for your favorite commands in DevTools. Go to Settings > Shortcuts, hover over a command and click the Edit button (pen icon) to customize the keyboard shortcut. You can create chords (a.k.a multi-key press shortcuts) as well. Chromium issues: 1335274, 174309 Toggle light and dark themes with keyboard shortcut Config

                                                                                  What's New In DevTools (Chrome 107)  |  Blog  |  Chrome for Developers
                                                                                • Database Transactions — PlanetScale

                                                                                  PlanetScale Postgres is the fastest way to run Postgres in the cloud. Plans start at just $5 per month. Learn more By Ben Dicken | January 14, 2026 Transactions are fundamental to how SQL databases work. Trillions of transactions execute every single day, across the thousands of applications that rely on SQL databases. What is a database transaction?A transaction is a sequence of actions that we w

                                                                                    Database Transactions — PlanetScale