我刚刚读到。 文章和演讲:
Filter: Remove any functions in the WHERE clause, don t include views in your Transact-SQL code, may need additional indexes.
如果我不使用这些观点,有哪些替代办法? 我指的是,就我的情况而言,我想从一个表格中挑选一些数据,然后使用另外几个选定的询问,从第一个选择的询问中就数据分类开展工作?
我如何能够有效地做到这一点?
感谢
我刚刚读到。 文章和演讲:
Filter: Remove any functions in the WHERE clause, don t include views in your Transact-SQL code, may need additional indexes.
如果我不使用这些观点,有哪些替代办法? 我指的是,就我的情况而言,我想从一个表格中挑选一些数据,然后使用另外几个选定的询问,从第一个选择的询问中就数据分类开展工作?
我如何能够有效地做到这一点?
感谢
该条没有某种背景就令人误解。
Red Gate在Execution Plans上有更好的文章。 http://www.simple-talk.com/search/default.aspx?search=execution+plan+basics”rel=“nofollow noreferer”
处理你列入名单的内容......
页: 1 将DD调往对方是中性的。
通常有 Nest的观点。 指数化的观点非常有用。
见我的回答和
2005年+月
在某些情况下,仓储程序和桌子是一个很大的选择,有时是最好的选择。
但有时,你可以这样做:
SELECT *
FROM (SELECT IdC, Name FROM Customer WHERE ....)
也就是说,你在大问题部分内发问。 我首先不喜欢这一点,但随着时间的推移,我认识到,有些问题没有解决。
HTH (Hope this Helps)!
......在我的情况中,我想从一个表格中挑选一些数据,然后使用另外几个选定的查询方法,从第一个选择的问询中排下一组数据?
这一点在模糊的方面是很小的,但正如你可能想到Common Table expressions 一样,你可以同你一道做一个问题,例如:
WITH First_CTE AS
(
SELECT Col1, Col2, Col3, ...
FROM Table
WHERE ...
GROUP BY ...
),
Second_CTE AS
(
SELECT Col1, Col2, Col3, ...
FROM First_CTE
WHERE ...
GROUP BY ...
)
SELECT *
FROM Second_CTE
WHERE ...
GROUP BY ...
ORDER BY ...
你们能够像你们所希望的那样,把许多联合起来。 如果你提出各种意见,只是为了便于撰写少数问题,那么这将是一个更好的选择。 但这是一个大的“如果”——这确实取决于你重新利用看法。
是否有储存的程序和表格
I ve got two tables: TableA Col1 Col2 TableB Col3 Col4 I want to join them together: SELECT * from TableA join TableB ON (...) Now, in place of ... I need to write an expression ...
TSQL query to select all records from Customer that has an Order and also select all records from customer that does not have an Order. The table Customer contains a primary key of CustomerID. The ...
I have a stored procedure which takes an XML parameter and inserts the data into multiple tables. If I run the stored procedure into a database using a SSMS query window, everything works fine. ...
Have a win 2003 box with MSSQL 2005 running on it. There is a database which is populated every morning with new/modified SalesOrder made the previous day. The database has several tables: SalesOrder, ...
I have a table with the following fields Id Name IsPublic i need to write a sql query that updates IsPublic to false where name has a duplicate. Only one of the duplicates should have IsPublic = ...
I have a Transact-SQL query that uses the IN operator. Something like this: select * from myTable where myColumn in (1,2,3,4) Is there a way to define a variable to hold the entire list "(1,2,3,4)"? ...
I ve got a content management system that contains a hierarchical structure of categories, with sub-categories subject to different ordering options at each level. Currently, that s retrieved by a (...
I m trying to transform the SQL Query below into Linq to SQL select Categorias.IdCategoria, Categorias.Nome, SUM(lancamentos.valor) from lancamentos left outer join Categorias on Lancamentos....