{"id":3665,"date":"2023-10-28T13:50:58","date_gmt":"2023-10-28T05:50:58","guid":{"rendered":"https:\/\/white-night.club\/?p=3665"},"modified":"2023-11-09T11:07:45","modified_gmt":"2023-11-09T03:07:45","slug":"ad105","status":"publish","type":"post","link":"https:\/\/white-night.club\/index.php\/2023\/10\/28\/ad105\/","title":{"rendered":"2082.\u00a0\u5bcc\u6709\u5ba2\u6237\u7684\u6570\u91cf"},"content":{"rendered":"\n<p>\u8868\uff1a&nbsp;<code>Store<\/code><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">+-------------+------+\n| Column Name | Type |\n+-------------+------+\n| bill_id     | int  |\n| customer_id | int  |\n| amount      | int  |\n+-------------+------+\nbill_id \u662f\u8fd9\u4e2a\u8868\u7684\u4e3b\u952e(\u5177\u6709\u552f\u4e00\u503c\u7684\u5217)\u3002\n\u6bcf\u4e00\u884c\u5305\u542b\u4e00\u4e2a\u8ba2\u5355\u7684\u91d1\u989d\u53ca\u76f8\u5173\u5ba2\u6237\u7684\u4fe1\u606f\u3002\n<\/pre>\n\n\n\n<p>\u7f16\u5199\u89e3\u51b3\u65b9\u6848\u627e\u51fa&nbsp;<strong>\u81f3\u5c11\u6709\u4e00\u4e2a&nbsp;<\/strong>\u8ba2\u5355\u7684\u91d1\u989d&nbsp;<strong>\u4e25\u683c\u5927\u4e8e<\/strong>&nbsp;<code>500<\/code>&nbsp;\u7684\u5ba2\u6237\u7684\u6570\u91cf\u3002<\/p>\n\n\n\n<p>\u8fd4\u56de\u7ed3\u679c\u683c\u5f0f\u5982\u4e0b\u793a\u4f8b\u6240\u793a\uff1a<\/p>\n\n\n\n<p><strong>\u793a\u4f8b 1:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>\u8f93\u5165\uff1a<\/strong>\nStore \u8868:\n+---------+-------------+--------+\n| bill_id | customer_id | amount |\n+---------+-------------+--------+\n| 6       | 1           | 549    |\n| 8       | 1           | 834    |\n| 4       | 2           | 394    |\n| 11      | 3           | 657    |\n| 13      | 3           | 257    |\n+---------+-------------+--------+\n<strong>\u8f93\u51fa\uff1a<\/strong> \n+------------+\n| rich_count |\n+------------+\n| 2          |\n+------------+\n<strong>\u89e3\u91ca\uff1a<\/strong>\n\u5ba2\u6237 1 \u6709 2 \u4e2a\u8ba2\u5355\u91d1\u989d\u4e25\u683c\u5927\u4e8e 500\u3002\n\u5ba2\u6237 2 \u6ca1\u6709\u4efb\u4f55\u8ba2\u5355\u91d1\u989d\u4e25\u683c\u5927\u4e8e 500\u3002\n\u5ba2\u6237 3 \u6709 1 \u4e2a\u8ba2\u5355\u91d1\u989d\u4e25\u683c\u5927\u4e8e 500\u3002<\/pre>\n\n\n\n<div style=\"height:60px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<blockquote class=\"wp-block-quote has-luminous-vivid-amber-color has-text-color\">\n<p>\u89e3\u9898\u601d\u8def<\/p>\n<cite><em>\u6d3e\u751f\u8868<\/em><\/cite><\/blockquote>\n\n\n\n<p>\u8bb0\u5f97\u7ed9\u6d3e\u751f\u8868\u4e2a\u522b\u540d\u3002\u81f3\u5c11\u6709\u4e00\u4e2a\u5927\u4e8e\u5c31\u884c\uff0c\u90a3\u4e48\u5148\u6d3e\u751f\u8868\u7b5b\u9009+\u53bb\u91cd\u9009\u51faid\uff0c\u518d\u76f4\u63a5count\u8ba1\u7b97\u7ed3\u679c\u96c6\uff0c\u5b8c\u4e8b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Write your MySQL query statement below\r\nSELECT COUNT(*) AS rich_count\r\nFROM (\r\n  SELECT DISTINCT customer_id\r\n  FROM Store\r\n  WHERE amount>500\r\n) t<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Leetcode\u9898\u76ee\uff1a\u6d3e\u751f\u8868\u67e5\u8be2<\/p>\n","protected":false},"author":1,"featured_media":2827,"comment_status":"open","ping_status":"","sticky":false,"template":"base","format":"standard","meta":{"footnotes":""},"categories":[42,25],"tags":[38],"_links":{"self":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/3665"}],"collection":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/comments?post=3665"}],"version-history":[{"count":0,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/3665\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/media\/2827"}],"wp:attachment":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/media?parent=3665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/categories?post=3665"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/tags?post=3665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}