This commit is contained in:
文永达 2023-03-15 00:10:24 +08:00
parent ecd0dc9969
commit d0f84de859
3 changed files with 83 additions and 0 deletions

42
source/_posts/Git.md Normal file
View File

@ -0,0 +1,42 @@
# Git
## Git 全局设置:
```shell
git config --global user.name "wenyongda"
git config --global user.email "bmdzh11713@163.com"
```
## 创建 git 仓库:
```shell
mkdir aaa
cd aaa
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://gitee.com/wenyongda/aaa.git
git push -u origin master
```
## 已有仓库
```shell
cd existing_git_repo
git remote add origin https://gitee.com/wenyongda/aaa.git
git push -u origin master
```
## 查看作者名称、作者邮箱
```shell
git config user.name
git config user.email
git config --list
```

View File

@ -221,6 +221,21 @@ systemctl restart network
ip addr ip addr
``` ```
## 端口映射
```shell
# 将 80 端口 映射到 8080端口上 dport为目标端口 to-port为来源端口
iptables -t nat -A PREROUTING -p tcp --dport 8080 -j REDIRECT --to-port 80
# 查看iptables规则
iptables -t nat -L -n -v
##
Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
12925 4377K DOCKER all -- * * 0.0.0.0/0 0.0.0.0/0 ADDRTYPE match dst-type LOCAL
0 0 REDIRECT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:8080 redir ports 80
```
## 软件安装 ## 软件安装
rpm 本地安装 rpm 本地安装

View File

@ -504,3 +504,29 @@ SELECT DECODE(AMOUNT, 0, NULL, 1, 1, AMOUNT) FROM T_PO_ORDERDETAIL;
``` ```
如果**AMOUNT**等于**0**,则返回**NULL**否则如果AMOUNT等于1则返回1否则返回**AMOUNT** 如果**AMOUNT**等于**0**,则返回**NULL**否则如果AMOUNT等于1则返回1否则返回**AMOUNT**
### DECODE替换NVL
在Oracle中DECODE函数通常可以替换使用NVL函数。DECODE函数可以在字段值满足多个条件时返回不同的结果值语法如下
```
DECODE(expr, search, result, default)
```
其中expr是要进行条件判断的表达式search是需要匹配的条件值result是匹配成功后返回的结果值default是在没有匹配成功时返回的默认值。
使用DECODE函数来替换NVL函数的示例如下
使用NVL函数处理NULL值
```
SELECT NVL(name, '未知') AS name FROM user;
```
使用DECODE函数替换NVL函数
```
SELECT DECODE(name, NULL, '未知', name) AS name FROM user;
```
以上语句中使用DECODE函数将name参数的NULL值替换为“未知”字符串。当name不为NULL时返回它本身的值。