Showing posts with label SQL. Show all posts
Showing posts with label SQL. Show all posts
Sunday, April 1, 2012
Thursday, February 23, 2012
Monday, February 6, 2012
Friday, October 7, 2011
Saturday, September 24, 2011
SQL window function
Just read the SQL cookbook and learn userful sql windows function.
Over()
NTILE
TSQL Date and Time function
WITH common_table_expression (Transact-SQL)
See a good list of SQL tutorial while googling:
Monday, September 5, 2011
Monday, June 27, 2011
Wednesday, June 22, 2011
Thursday, June 16, 2011
多db record 處理情況
今日試左兩個好多record 既database table,基本上一join 就會load 太長時間timeout
同埋用左好多以前無寫既野,好似
1. declare variable
2. temp table
@tmptable, @@tmptable, #tmptable 既分別
Tuesday, July 20, 2010
sql 2000 problem
Warning: The table 'xxx' has been created but its maximum row size (8707) exceeds the maximum number of bytes per row (8060). INSERT or UPDATE of a row in this table will fail if the resulting row length exceeds 8060 bytes.
Thursday, March 25, 2010
Oracle Special Table - Dual
Oracle:
Dual is a special table with a garbage cell which is used for our queries.
For example,
select seq.nextval from dual
Dual is a special table with a garbage cell which is used for our queries.
For example,
select seq.nextval from dual
Monday, November 23, 2009
Wednesday, November 18, 2009
Monday, September 14, 2009
Select 30% of records randomly in SQL Server
select top 30 percent * from [table_name] ORDER BY NEWID()
select 30% of records of last month
select top 30 percent * from[table_name]
and DatePart(""m"", date_created) = DatePart(""m"", DateAdd(""m"", -1, getdate()))
AND DatePart(""yyyy"", date_created) = DatePart(""yyyy"", DateAdd(""m"", -1, getdate()))
ORDER BY NEWID()
select 30% of records of last month
select top 30 percent * from[table_name]
and DatePart(""m"", date_created) = DatePart(""m"", DateAdd(""m"", -1, getdate()))
AND DatePart(""yyyy"", date_created) = DatePart(""yyyy"", DateAdd(""m"", -1, getdate()))
ORDER BY NEWID()
Tuesday, August 25, 2009
Thursday, August 6, 2009
Tuesday, July 21, 2009
Tuesday, May 26, 2009
Top 10 steps to optimize data access in SQL Server
Top 10 steps to optimize data access in SQL Server
Part I:
http://www.codeproject.com/KB/database/OptimizeDBUseIndexing.aspx
Part II:
http://www.codeproject.com/KB/database/RefactorTSQLs.aspx
Part III:
http://www.codeproject.com/KB/database/IndexAndDenormalize.aspx
Part I:
http://www.codeproject.com/KB/database/OptimizeDBUseIndexing.aspx
Part II:
http://www.codeproject.com/KB/database/RefactorTSQLs.aspx
Part III:
http://www.codeproject.com/KB/database/IndexAndDenormalize.aspx
Subscribe to:
Posts (Atom)