编辑
2023-09-26
后端
00

image.png

编辑
2023-09-26
后端
00

image.png

image.png

也是有两种解法

sql
create table Person( id int primary key, email varchar(20) ) ; show tables;
编辑
2023-09-26
后端
00

image.png

image.png

解法一:临时表

SQL
create table weather( id int primary key , recordData date , temperature int ); show tables; select * from weather; insert into weather values (1,'2015-01-01',10),(2,'2015-01-02',25),(3,'2015-01-03',20),(4,'2015-01-04',30); select a.id from weather as a,weather as b where a.temperature > b.temperature and datediff(a.recordData,b.recordData) = 1;

解法二:自连接

sql
select a.id from weather as a join weather as b on datediff(a.recordData,b.recordData) = 1 where a.temperature > b.temperature ;
编辑
2023-09-26
英语学习
00

When I’m lost in Chinese cities I stop a taxi and give them my destination written on a piece of paper (in Chinese characters, supplied by a friend or hotel staff). Taxis are relatively cheap in China.

中文翻译

当我在中国的城市迷路时,我会拦下一辆出租车,然后给司机看一张纸上写着我的目的地的纸条(用中文字符书写,由朋友或酒店工作人员提供)。在中国,出租车相对便宜。

  • When:当。
  • I’m lost:我迷路了。
  • in Chinese cities:在中国的城市。
  • I stop a taxi:我拦下一辆出租车。
  • and give them:并给他们。
  • my destination:我的目的地。
  • written on a piece of paper:写在一张纸上。
  • in Chinese characters:用中文字符。
  • supplied by a friend:由朋友提供。
  • or hotel staff:或酒店工作人员。
  • Taxis are:出租车相对。
  • relatively cheap:相对便宜。
  • in China:在中国。
编辑
2023-09-26
后端
00

我的博客运行在80端口,直接通过域名访问,但是我有其他的demo项目也需要运行在80端口,这样我们不用在丑陋的域名后面加上端口号了,怎么做呢,这时候需要用nginx做一个反向代理,nginx真正的运行在80端口,负责接收外来请求根据请求的域名来转发给不同的服务,我的服务时运行在8080和8081端口,nginx配置文件如下

events { worker_connections 1024; } http { server { listen 80; server_name www.wmyh.top; location / { proxy_pass http://localhost:8080; } } server { listen 80; server_name www.yowayimono.cn; location / { proxy_pass http://localhost:8081; } } }

很简单,我们把nginx运行在容器中,docker run --name nginx -p 80:80 -v /root/nginx/nginx.conf:/etc/nginx/nginx.conf -d nginx ,挂载配置文件。运行就可以了。你还可以配置更多的服务。