{"id":2119,"date":"2022-02-23T19:16:02","date_gmt":"2022-02-23T10:16:02","guid":{"rendered":"http:\/\/wp.ultimai.org\/?p=2119"},"modified":"2022-04-07T06:18:56","modified_gmt":"2022-04-06T21:18:56","slug":"lalavel8-subquery","status":"publish","type":"post","link":"https:\/\/wp.ultimai.org\/?p=2119","title":{"rendered":"lalavel8 \u30b5\u30d6\u30af\u30a8\u30ea\u30fc (\u30af\u30a8\u30ea\u30d3\u30eb\u30c0\u30fc)"},"content":{"rendered":"<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\r\n<code>\r\n $sql = \"SELECT \u2190\u666e\u901a\u306eSQL\u6587\r\n FROM\r\n WHERE \" ; \r\n \r\n\r\n DB::table('app_user_user AS uu')\r\n        ->select( ~ ~ \r\n\r\n    ) ->leftJoin( DB::raw(\"( $sql  ) AS sc \") , 'uu.id', '=', 'sc.user_id')\r\n<\/code>\r\n<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\r\n<code>\r\n\t$juhuku = DB::table('issuers')\r\n\t\t->orWhere(function($query) {\r\n\t\t\t$query->where('tel', $this->tel[$this->j])\r\n\t\t\t->where('user_id', '!=', $this->user_id);\r\n\t\t})\r\n\t\t->orWhere(function($query) {\r\n\t\t$query->where('email', $this->email[$this->j])\r\n\t\t->where('user_id', '!=', $this->user_id);\r\n\t})->exists() ;\r\n<\/code>\r\n<p>\r\n<br><br>\r\n<code>\r\nselect exists(\r\n  select * from `issuers` \r\n  where (\r\n   `tel` = '230-0234-5432' \r\n    and `user_id` != 4604\r\n   )\r\n or (\r\n   `email` = 'izumo@reqw.wer' \r\n    and `user_id` != 4604) \r\n ) as `exists`\r\n<\/code>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>$sql = &#8220;SELECT \u2190\u666e\u901a\u306eSQL\u6587 F [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2119","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/wp.ultimai.org\/index.php?rest_route=\/wp\/v2\/posts\/2119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.ultimai.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.ultimai.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.ultimai.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.ultimai.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2119"}],"version-history":[{"count":3,"href":"https:\/\/wp.ultimai.org\/index.php?rest_route=\/wp\/v2\/posts\/2119\/revisions"}],"predecessor-version":[{"id":2137,"href":"https:\/\/wp.ultimai.org\/index.php?rest_route=\/wp\/v2\/posts\/2119\/revisions\/2137"}],"wp:attachment":[{"href":"https:\/\/wp.ultimai.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.ultimai.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.ultimai.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}