select实战#130
Merged
Merged
Conversation
Contributor
|
🎉 感谢提交Pull Request!请稍等片刻,我们已经将其提交到CI进行检查,一旦有结果会立即通知您! 我们不鼓励同时打开多个Pull Request,请集中精力于现在的这个Pull Request,谢谢!:pray: |
hcsp-bot
reviewed
May 31, 2020
| import java.sql.Connection; | ||
| import java.sql.DriverManager; | ||
| import java.sql.SQLException; | ||
| import java.sql.*; |
Contributor
There was a problem hiding this comment.
不应使用 '.*' 形式的导入 - java.sql.* 。
| public static List<GoodsAndGmv> getGoodsAndGmv(Connection databaseConnection) throws SQLException { | ||
| return null; | ||
| List<GoodsAndGmv> goodsAndGmvList = new ArrayList<>(); | ||
| try (PreparedStatement statement = databaseConnection.prepareStatement("select GOODS_ID, GOODS.NAME, sum(GOODS_NUM * GOODS_PRICE) as total\n" + |
| return null; | ||
| List<GoodsAndGmv> goodsAndGmvList = new ArrayList<>(); | ||
| try (PreparedStatement statement = databaseConnection.prepareStatement("select GOODS_ID, GOODS.NAME, sum(GOODS_NUM * GOODS_PRICE) as total\n" + | ||
| "from `ORDER`\n" + |
| List<GoodsAndGmv> goodsAndGmvList = new ArrayList<>(); | ||
| try (PreparedStatement statement = databaseConnection.prepareStatement("select GOODS_ID, GOODS.NAME, sum(GOODS_NUM * GOODS_PRICE) as total\n" + | ||
| "from `ORDER`\n" + | ||
| " join GOODS on `ORDER`.GOODS_ID = GOODS.ID\n" + |
| try (PreparedStatement statement = databaseConnection.prepareStatement("select GOODS_ID, GOODS.NAME, sum(GOODS_NUM * GOODS_PRICE) as total\n" + | ||
| "from `ORDER`\n" + | ||
| " join GOODS on `ORDER`.GOODS_ID = GOODS.ID\n" + | ||
| "group by GOODS_ID\n" + |
| return null; | ||
| List<Order> orderList = new ArrayList<>(); | ||
| try (PreparedStatement statement = databaseConnection.prepareStatement("select \"ORDER\".ID, U.NAME, G.NAME, GOODS_NUM * GOODS_PRICE\n" + | ||
| "from `ORDER`\n" + |
| List<Order> orderList = new ArrayList<>(); | ||
| try (PreparedStatement statement = databaseConnection.prepareStatement("select \"ORDER\".ID, U.NAME, G.NAME, GOODS_NUM * GOODS_PRICE\n" + | ||
| "from `ORDER`\n" + | ||
| " join USER U on `ORDER`.USER_ID = U.ID\n" + |
| public static List<Order> getLeftJoinOrders(Connection databaseConnection) throws SQLException { | ||
| return null; | ||
| List<Order> orderList = new ArrayList<>(); | ||
| try (PreparedStatement statement = databaseConnection.prepareStatement("select \"ORDER\".ID, U.NAME, G.NAME, GOODS_NUM * GOODS_PRICE\n" + |
| return null; | ||
| List<Order> orderList = new ArrayList<>(); | ||
| try (PreparedStatement statement = databaseConnection.prepareStatement("select \"ORDER\".ID, U.NAME, G.NAME, GOODS_NUM * GOODS_PRICE\n" + | ||
| "from `ORDER`\n" + |
| List<Order> orderList = new ArrayList<>(); | ||
| try (PreparedStatement statement = databaseConnection.prepareStatement("select \"ORDER\".ID, U.NAME, G.NAME, GOODS_NUM * GOODS_PRICE\n" + | ||
| "from `ORDER`\n" + | ||
| " left join USER U on `ORDER`.USER_ID = U.ID\n" + |
Contributor
|
你的提交 b4edcf3 ,似乎失败了:Your tests failed on CircleCI 😅 请不要气馁,仔细分析原因,再接再厉! |
1 similar comment
Contributor
|
你的提交 b4edcf3 ,似乎失败了:Your tests failed on CircleCI 😅 请不要气馁,仔细分析原因,再接再厉! |
Contributor
|
你的提交 3e27a52 ,似乎失败了:Your tests failed on CircleCI 😅 请不要气馁,仔细分析原因,再接再厉! |
1 similar comment
Contributor
|
你的提交 3e27a52 ,似乎失败了:Your tests failed on CircleCI 😅 请不要气馁,仔细分析原因,再接再厉! |
Contributor
|
恭喜你,你的提交 f0fb091 已经通过我们的CI检查:Your tests passed on CircleCI! 👍 它会被自动merge后revert。请不要骄傲,继续挑战! |
hcsp-bot
reviewed
May 31, 2020
| " left join GOODS G on `ORDER`.GOODS_ID = G.ID")) { | ||
| ResultSet resultSet = statement.executeQuery(); | ||
| while (resultSet.next()) { | ||
| Order order = new Order(); |
Contributor
There was a problem hiding this comment.
你看这个方法是不是和getInnerJoinOrders有大量的代码重复?考虑过抽取一个公用方法出来么?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SQL语言SELECT实战