使用MYSQL -I
命令,查看MYSQL命令的
参数,其中对--auto-rehash参数的说明如下:--auto-rehash Enable automatic rehashing. One doesn&#39t need to use &#39rehash&#39to get table and field completion, but startup and reconnecting may take a longer time. Disable with --disable-auto-rehash. 网上也找了一些资料,说是打开MYSQL的自动补
全功能,类似于LINUX的TAB键补全功能。但如下使用该参数后,输入SQL命令,中途按TAB健,并未出现自动补全的效果,不知道如何 *** 作: [sql] C:\Users\qxlmysql -u root --auto-rehash Welcome to the MySQL monitor. Commands end with or \g. Your MySQL connection id is 29 Server version: 5.1.28-rc-community MySQL Community Server (GPL) Type &#39help&#39or &#39\h&#39for help. Type &#39\c&#39to clear the buffer. mysql use test Database changed mysql select * from newnam
在orderid顺序排列或者有顺序列的情况下,可以使用自连接对比循环来依次补全:
declare @i int
declare @j int
set @i = 1
select @j = ( select count(*) as cont from tb )
while @i <= @j
begin
update a set a.proid=b.proid from tb a inner join tb b on a.orderid = b.orderid + 1 where a.orderid = @i and a.proid is null
set @i = @i + 1
end
评论列表(0条)