Viewing 15 posts - 211 through 225 (of 1,156 total)
You also have to keep in mind that the selectivity of an index determines whether or not it is used. There is a direct relationship between the the number...
March 25, 2008 at 12:36 pm
You will have problems when your purchase amount is not a whole number, unless you want decimal values.
select 19999.99 / 15000
If you want to remedy this you can use floor.
select...
March 25, 2008 at 12:23 pm
Not sure how it could possibly be a seek with the leading % in the LIKE statement....
Is there a OPTION (FAST N) statement anywhere? All of these should end...
March 25, 2008 at 11:57 am
If you want to display 2 instead of 15000, take off the multiplication at the end.
This was supposed to read if you want to display 2, instead of 30000.
March 25, 2008 at 11:25 am
SELECT FLOOR(MySumColumn / 15000) * 15000
If you want to display 2 instead of 15000, take off the multiplication at the end.
March 25, 2008 at 11:24 am
Make a derived table with the sum for the consultant. You can then join that to your main query on the appropriate id. This way the amount is...
March 25, 2008 at 10:50 am
What do you execution plans look like? You may be doing a table scan with 2 chars and maybe your 3 chars is using index seeks.
March 25, 2008 at 10:43 am
After a little research it seems that it is equivlant to a left join, but the actual plan is more like a NOT IN statement.
See the link below:
http://blog.sqlauthority.com/2007/05/22/sql-server-2005-comparison-except-operator-vs-not-in/
March 25, 2008 at 10:38 am
I have done a small scale test (not the million row type you do) and it did in fact use the same query plan. Obviously, the main difference here...
March 25, 2008 at 10:19 am
Except operates as an outer join. It compares the results of both queries and returns distinct values of the left table. These are the values that exist in...
March 25, 2008 at 7:03 am
Sorry, for the formatting. It seems no matter how I format the code this site add/strips spaces.
March 24, 2008 at 3:46 pm
INSERT INTO TableA (CUST_NUM, ITEM_NUM, SERIAL_NUM)
SELECT CUST_NUM, ITEM_NUM, SERIAL_NUM
FROM TableB
WHERE NOT EXISTS (SELECT 1
...
March 24, 2008 at 3:43 pm
It sounds like you need to create a stored procedure that will accept a username passed in. The stored procedure should delete the duplicate data for the user attempting...
March 24, 2008 at 3:12 pm
SELECT *
FROM Property a
left JOIN Assigned_properties b
on a.propertyid = b.propertyid
where b.property_id is null
Also, you could use except
SELECT Property_id
from Property
except
select property_id
from assigned_properties
March 24, 2008 at 2:35 pm
Make sure you are in the right database. You can see what database you are in via the dropdown at the top of the screen. It is next...
March 24, 2008 at 1:10 pm
Viewing 15 posts - 211 through 225 (of 1,156 total)