SELECT (MAX(qm)-MAX(qc))/MAX(qc) * 100 AS lending_change_rate_1m
时间: 2024-04-11 16:32:53 浏览: 18
你的 SQL 语句看起来是正确的,计算了一个名为 "lending_change_rate_1m" 的指标。这个指标计算了 "qm" 列和 "qc" 列的最大值之差除以 "qc" 列的最大值,并乘以 100。
如果你遇到了 "SQL parse failed" 的错误,可能有以下几个原因:
1. 版本兼容性:检查你使用的 Flink 版本是否支持这个语法。不同的 Flink 版本可能会有略微不同的语法要求。
2. 表或列名错误:确保 "qm" 和 "qc" 列存在于你的查询中,并且它们的名称没有拼写错误。
3. 语法错误:检查你的 SQL 查询中是否还有其他语法错误,如缺少括号、引号不匹配等。可以尝试将查询拆分为简单的部分进行逐步测试,以确定具体哪一部分出现了问题。
希望这些提示能帮助你解决问题。如果还有其他问题,请随时提问。
相关问题
lendingclub 2020数据下载
要下载LendingClub 2020的数据,你可以按照以下步骤进行:
首先,访问LendingClub的官方网站(www.lendingclub.com)。在主页上,你可以找到一个名为"Data & Statistics"或类似名称的选项。
点击该选项后,你将被重定向到一个数据平台页面,上面会显示有关LendingClub借贷数据的相关信息。在这个页面上,你将看到各种可用的数据集和报告。
选择你想要下载的数据集。通常,它们以年份为基础进行组织,所以你需要找到LendingClub 2020数据集。点击数据集的链接或按钮,以打开该数据集的相关页面。
在数据集页面上,你将看到有关数据集内容和特征的详细信息。此外,也许还会有一些说明和指导,以帮助你更好地理解和使用该数据。
找到并点击下载按钮或链接,以开始数据下载过程。你可能需要提供一些必要的信息,如你的电子邮件地址或登录凭据,以便允许你下载数据。
下载所需数据集后,你可以将其保存到你的计算机中的指定位置。确保你选择一个易于找到和访问的文件夹。
完成以上步骤后,你就可以开始使用LendingClub 2020数据进行分析、研究或其他有关借贷行业的工作了。
请注意,以上的步骤是一般性的描述,具体情况可能会略有不同。因此,在实际下载数据之前,你可能需要参考LendingClub官方网站上的指南或联系他们的客户支持部门,以获取更准确和详细的信息。
use java language ,In this project you need to write a book lending system for a Library. The system has different roles for registered users. There are two types of user roles: borrower and lender. Write an IUser interface for library users, with the following UML specification: +----------------------------------+ | <<interface>> | | IUser | +----------------------------------+ | + getName(): String | | + getBook(): int | | + moreBook(int number): void | +----------------------------------+ and a User class that implements IUser and has the following UML specification: +-----------------------------------+ | User | +-----------------------------------+ | - name: String | | - book: int | +-----------------------------------+ | + User(String name, int book) | | + getName(): String | | + getBook(): int | | # setBook(int book): void | | + moreBook(int number): void | | + testUser(): void | +-----------------------------------+ The name instance variable indicates the user name. The book instance variable indicates the number of books borrowed by the user. The setBook method changes the number of books borrowed by the user. The setBook method is protected, not public. This means that only subclasses of the User class can use the setBook method. All the other classes in the system cannot use the setBook method, so they cannot change the number of books borrowed by a user. The purpose of the moreBook method is to increase the number of books borrowed or lent by the user (depending on what kind of user it is) by the number given as argument to the method. The moreBook method of the User class is abstract, since we do not know what kind of role the user is (a borrower borrows books from other users and a lender lend books to other users). Also add to your program a Test class to test your User class. public class Test { public static void main(String[] args) { User.testUser(); } }
Sure, I can help you with that! Here's the code for the IUser interface and User class:
IUser interface:
```java
public interface IUser {
String getName();
int getBook();
void moreBook(int number);
}
```
User class:
```java
public class User implements IUser {
private String name;
private int book;
public User(String name, int book) {
this.name = name;
this.book = book;
}
@Override
public String getName() {
return name;
}
@Override
public int getBook() {
return book;
}
protected void setBook(int book) {
this.book = book;
}
public void moreBook(int number) {
// abstract method, implementation will be provided in subclasses
}
public static void testUser() {
User borrower = new Borrower("John", 2);
User lender = new Lender("Jane", 5);
System.out.println("Borrower " + borrower.getName() + " has " + borrower.getBook() + " books borrowed.");
System.out.println("Lender " + lender.getName() + " has " + lender.getBook() + " books lent.");
borrower.moreBook(1);
lender.moreBook(3);
System.out.println("Borrower " + borrower.getName() + " has " + borrower.getBook() + " books borrowed.");
System.out.println("Lender " + lender.getName() + " has " + lender.getBook() + " books lent.");
}
}
```
The User class has a constructor that takes a name and a number of books as arguments. It also implements the methods of the IUser interface.
The setBook method is protected, meaning it can only be accessed by subclasses of User.
The moreBook method is abstract, as its implementation will depend on the type of user (borrower or lender). This will be implemented in the subclasses.
Here's an example of two subclasses, Borrower and Lender, that extend User and implement the moreBook method:
```java
public class Borrower extends User {
public Borrower(String name, int book) {
super(name, book);
}
@Override
public void moreBook(int number) {
setBook(getBook() + number);
}
}
public class Lender extends User {
public Lender(String name, int book) {
super(name, book);
}
@Override
public void moreBook(int number) {
setBook(getBook() - number);
}
}
```
The Borrower class increases the number of books borrowed, while the Lender class decreases the number of books lent.
And finally, here's the Test class to test the User class:
```java
public class Test {
public static void main(String[] args) {
User.testUser();
}
}
```
This will create a Borrower and a Lender object, print their initial number of books, call the moreBook method on both objects, and print the new number of books.