我需要查找特定时间范围内的行.
select *
from TableA
where startdate >= '12-01-2012 21:24:00'
and startdate <= '12-01-2012 21:25:33'
Run Code Online (Sandbox Code Playgroud)
即查找时间戳精度为秒的行,我该如何实现?
有下面的shell,它在(while true)循环中有一个(while true)循环.我试图用"休息"打破内循环,但事实并非如此.我想打破内循环并向用户显示第一循环的选项; 建议请.
#!/bin/ksh
sub_menu() {
echo "~~~~~~~~~~~~~~~~~~~~~~~~~"
echo " S U B - M E N U "
echo "~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "1. Display properties"
echo "2. Back"
}
read_sub_options(){
echo "Please select option"
read option
case $option in
1) sub_menu ;;
***2) break ;;***
*) echo "Please insert options 1 ~ 2";;
esac
}
showSubMenu(){
while true
do
sub_menu
read_sub_options
done
}
read_options(){
echo "Please select option "
read option
case $option in
1) showSubMenu ;;
2) exit …Run Code Online (Sandbox Code Playgroud) 我试图在shell脚本中使用sed替换属性文件中的属性; 下面列出的命令完全正常
sed "s!${KEY}=.*!${KEY}=${NEWVAL}!" infile > outfile
Run Code Online (Sandbox Code Playgroud)
问题 - 这个人也会在评论中替换匹配的"KEY".
示例文件:
###########
#ws.clients=http://abc123.com
ws.clients=http://123.com
###########
Run Code Online (Sandbox Code Playgroud)
脚本:
#!/bin/ksh
KEY="ws.clients"
NEWVAL="http://abcd.com"
sed "s!${KEY}=.*!${KEY}=${NEWVAL}!" infile > outfile
Run Code Online (Sandbox Code Playgroud)
输出:
###########
#ws.clients=http://abcd.com
ws.clients=http://abcd.com
###########
Run Code Online (Sandbox Code Playgroud)
我尝试了几种方法但是没有成功地从"#"......建议开始逃避这条线路?