Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
abc
Starting Member
48 Posts |
Posted - 2001-11-14 : 06:15:42
|
| Hello, if I have two queries are return the same result setsexample: Fist query have where clause: SELECT pub_id, SUM(advance) AS AmountAdvanced, AVG(price) AS AveragePriceFROM pubs.dbo.titlesWHERE pub_id > '0800'GROUP BY pub_idHAVING SUM(advance) > $15000 AND AVG(price) < $20Second query (have no where clause, the condition is used in having clause)SELECT pub_id, SUM(advance) AS AmountAdvanced, AVG(price) AS AveragePriceFROM pubs.dbo.titlesGROUP BY pub_idHAVING SUM(advance) > $15000 AND AVG(price) < $20 AND pub_id > '0800'I want to use the one optimizer than the other. But I don't know wich one should I select. So could you tell me the way (in commond) to determind wich query otimizer than otherThanks for your attention |
|
|
|
|
|