sql update Ó÷¨
½«b±íÖÐcallerÁеÄÖµ²åÈëa±íÖÐcallÁÐÖС£
create table a
(
fid int,
call varchar(20),
age int
)
create table b
(
fid int,
caller varchar(20),
parentId int
)
select * from a
select * from b
insert into a values(1,null,19)
insert into a values(2,null,20)
insert into b values(1,'a',1)
insert into b values(2,'b',2)
update a set call =b.caller from b inner join a on a.fid = b.parentId
Ïà¹ØÎĵµ£º
ÔÚÎÒÃǵÄÈÕ³£±à³ÌÖУ¬Êý¾Ý¿âµÄ³ÌÐò»ù±¾É϶¼ÒªÓëSQLÓï¾ä´ò½»µÀ£¬SQLÓï¾äµÄ±àд²»¿É±ÜÃâµÄ³ÉΪһ¸öÍ·Ì۵Ť×÷¡£ÇÒÒòΪSQLÓï¾äÊÇSTRINGÀàÐÍ£¬Òò´ËÔÚ±àÒë½×¶Î²é²»³ö´í£¬Ö»Óе½ÔËÐÐʱ²ÅÄÜ·¢ÏÖ´íÎó¡£
±¾ÎĵĽâ¾ö·½°¸£¬Í¨¹ý×Ô¶¯Éú³ÉSQLÓï¾ä£¬ÔÚÒ»¶¨³Ì¶ÈÉϽµµÍ³ö´íµÄ¸ÅÂÊ£¬´Ó¶øÌá¸ß±à³ÌЧÂÊ¡£ public int ......
1¡¢²éÕÒ±íÖжàÓàµÄÖØ¸´¼Ç¼£¬Öظ´¼Ç¼ÊǸù¾Ýµ¥¸ö×ֶΣ¨peopleId£©À´ÅжÏ
select * from people
where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1)
2¡¢É¾³ý±íÖжàÓàµÄÖØ¸´¼Ç¼£¬Öظ´¼Ç¼ÊǸù¾Ýµ¥¸ö× ......
2000·¢²¼Óë¶©ÔÄ
Ô¤±¸¹¤×÷
1.·¢²¼·þÎñÆ÷,¶©ÔÄ·þÎñÆ÷¶¼´´½¨Ò»¸öͬÃûµÄwindowsÓû§,²¢ÉèÖÃÏàͬµÄÃÜÂë,×öΪ·¢²¼¿ìÕÕÎļþ¼ÐµÄÓÐЧ·ÃÎÊÓû§
--¹ÜÀí¹¤¾ß
--¼ÆËã»ú¹ÜÀí
--Óû§ºÍ×é
--ÓÒ¼üÓû§
--н¨Óû§
--½¨Á¢Ò»¸öÁ¥ÊôÓÚadministrator×éµÄµÇ½windowsµÄÓû§£¨SynUser£©
2.ÔÚ·¢²¼·þÎñÆ÷ÉÏ,н¨Ò»¸ö¹²ÏíĿ¼ ......
±¸·Ý
DECLARE @strPath NVARCHAR(200)
set @strPath = convert(NVARCHAR,getdate(),120)
set @strPath='hq'+rtrim(left(replace(@strPath,'-',''),8))
set @strPath = 'D:\sqlback\mydb\' + @strPath + '.bak'
BACKUP DATABASE [mydb] TO DISK = @strPath WITH NOFORMAT, NOINIT, NAME = N'mydb-ÍêÕû Êý¾Ý¿â ±¸·Ý', ......