In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1. Remove the spaces in the record
Ltrim () remove the left space rtrim () remove the right space
Select ltrim (rtrim (field name)) from table name.
2. Increase
INSERT INTO table_name (column 1, column 2.) VALUES (value 1, value 2...) INSERT INTO table name VALUES (value 1, value 2...) insert into table name 1 (column name 1, column name 2...) Select list a, column b... From table name 2 (provided that table 1 already exists and the field data type is compatible with table 2) for example: insert into rpc (DATE,BM,KB,TRGS,CPGS,DCL,RPB001,RPB002) select * from rpb
3. Delete
DELETE FROM table name WHERE column name = value
4. Change
UPDATE table name SET column name = new value WHERE column name = some value 5, new trigger 6, transaction BEGIN TRANUPDATE COPMA SET MODI_DATE = '20140609000000000' WHERE MA001='001' select * from COPMA select * from COPMA WHERE MA001='001'rollback tran-- rollback transaction commit tran-- complete and save transaction 7, stored procedure 8, cursor 9, deduplicated record "has two duplicate records, one is a completely duplicated record. That is, records in which all fields are duplicated, and second, records in which some key fields are duplicated, such as the Name field, while other fields are not necessarily duplicated or can be ignored. For the first kind of repetition, it is relatively easy to solve. Use select distinct * from tableName the second repetition (follow-up supplement) 10, check the trigger or stored procedure EXEC sp_helptext trigger name / stored procedure name 11, determine whether a table already exists in the database, delete the table if (Select * From SysObjects Where xtype='U' And Name=' table name') drop table table name 12, detect whether # # CFGEJGS exists If yes, delete the table if exists (select * from tempdb.dbo.sysobjects where id= object_id (Noble tempdb.. deleted CFGEJGSs') drop table # # CFGEJGS13 and insert the date of the year into the DATE field of the DCLHZ table. Note the usage of the dateadd function select top 365 id=identity (int,0,1) into tmp from syscolumns a Syscolumns b insert into DCLHZ (DATE) select dateadd (day,id) '2014-01-01') from tmp drop table tmp14, view the size of space occupied by a table the name of the sp_spaceused' table
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.