SELECT * FROM (SELECT id, name, age, count(*) sum FROM person GROUP BY id, name, age) WHERE sum > 1; ...
分类:
数据库 时间:
2020-07-28 22:39:41
阅读次数:
78
Princess CJB has lived almost her entire life in the isolated town of Ertona, where CJB uses her unique ability to recognize where crystals of materia ...
分类:
其他好文 时间:
2020-07-28 22:14:42
阅读次数:
73
-- 查看被锁对象 select object_name, machine, s.sid, s.serial# from v$locked_object l, dba_objects o, v$session s where l.object_id = o.object_id and l.sessi ...
分类:
数据库 时间:
2020-07-28 17:10:59
阅读次数:
81
1、数据库查询的三种方式 正向查询: (1)获取全部数据all v1=models.UserInfo.objects.all().first() #取出Querryset类型数据,里面是对象,需循环取出 v1.ut #跨表,ut是外键 (2)只取部分字段value, 外键__字段 v2=models ...
分类:
数据库 时间:
2020-07-28 16:57:44
阅读次数:
67
报错原因就是没有给用户添加远程权限 解决如下: 1.进入MySQL 命令:[root@localhost mysql]# mysql -uroot -p123456 # -p‘密码写自己设置的’ 2.进入MySQL库 命令:mysql> use mysql; 3.查看mysql库中的user表的ho ...
分类:
数据库 时间:
2020-07-28 14:36:53
阅读次数:
90
从效率来看: 1): select * from T1 where exists(select 1 from T2 where T1.a=T2.a) T1数据量小而T2数据量非常大时,T1 << T2时,1):的查询效率高 2): select * from T1 where T1.a in (se ...
分类:
其他好文 时间:
2020-07-28 14:07:55
阅读次数:
62
Given two words word1 and word2, find the minimum number of steps required to make word1 and word2 the same, where in each step you can delete one cha ...
分类:
其他好文 时间:
2020-07-28 14:04:15
阅读次数:
77
if not exists(select * from sys.columns where [object_id] = object_id('szydytglhyytb') and name = 'SZYDYTGLHYYTB_HYBM') BEGINalter table szydytglhyytb ...
分类:
其他好文 时间:
2020-07-28 13:54:54
阅读次数:
56
DBCC TRACEON (1204, -1)DBCC TRACEON (1222, -1) SELECT cntr_value AS NumOfDeadLocks FROM sys.dm_os_performance_counters WHERE object_name = 'SQLServer: ...
分类:
其他好文 时间:
2020-07-28 13:49:28
阅读次数:
71
前言 SQL作为Web开发是永远离开不的一个话题,天天写SQL,可是你知道一个SQL是如何执行的吗? select name from user where id = 1; 上面是一个简单的查询语句,交给数据库去执行,然后返回name。看起来很简单,可是内部的执行过程却很多人都不知道。 今天就把My ...
分类:
数据库 时间:
2020-07-27 13:47:56
阅读次数:
130