I have two tables, an I'm trying to list all the items from I_ToDecide.stock_code which do not have a corresponding value in I_Stock_Colours.colour_stock_code.
When I do a query using IN (SELECT...), the correct results are retured, but when I do a NOT IN (SELECT...), no values are returned...
I have a table from which I need to select all records with a 'matching pair of fields'.
For example my table contains the following structure, and the fields I'm matching are FIELD1 and FIELD3
ID FIELD1 FIELD2 FIELD3
1 Bob Ted Reg
2 Bob Peter
3 Bob...
I have two tables, Merged_Stock and I_Products. I_Products has a field 'stock_code'. Merged_Stock has two fields, 'old_stock_code' and 'new_stock_code'. I want to write a query which updates I_Products.stock_code with Merged_Stock.new_stock_code. Records will be matched on I_Products.stock_code...
I'm trying to run a query which returns three fields, one of the fields needs any potential leading space stripped off. Due to my being a bit SQL-retarded, I can't get it working. Any help appreciated...
SELECT DISTINCT kpp.plan_phone_code + kpp.plan_phone_suffix AS Plan_Code...
Thanks Tim for you efforts, however this is not what I want. The query is simply a 'select' query returning (ultimately) a recordset to display. No updating is done as such, I still want the Territory_Code to remain the way it is on file, but I want the query to return a different value (as...
There are two problems with the query below...
1. I'm trying to populate the field 'Territory_Code' with '900' if the Conn.Rep_Code exists in Table CCR, and populate it with the Conn.Territory_Code if it doesn't. I've got the first part working (populating certain records with '900') but you're...
Here is my problem....
There is a view which displays connection profit amounts for stores.
View CONN_PROFIT
DATE STORE_ID CONN_PROFIT
01-Sep-2001 603 56.00
01-Sep-2001 603 144.00
01-Sep-2001 603 500.00
01-Sep-2001 604 200.00
01-Sep-2001 605...
Terry,
You are certainly a wealth of knowledge on SQL, how long have you been doing it for ?
Thanks for your suggestions. I have done what you said points 2,3,4 and 5.
Point 6....I've tried creating a storod procedure. When I run this query (with no stored procedure), it takes around 40...
Thanks tapks
OK, so you mention creating indices, there are about four fields that this query can be sorted on.
Given this query is a query over a view, what do I do ? Do I need to create nonclustered indices for the tables I'm querying, or do I create seperate views with different order by...
Greetings all (esp Terry !),
OK I'm quite new to SQL Server and Transact-SQL and know very little about getting the best performance.
I'm programming for a company and I have a massive query...Here it is...
SELECT S.sys_description AS STORE, V.Territory_Code, (IsNull(Sum(V.Conn_Profit),0) +...
Terry, you are certainly a fountain of knowledge !!!
Our website is being hosted by an ISP, Telstra (THE major Australian telecomms company). Therefore I don't think that we are able to replicate data between our servers, it's not allowed. We ARE allowed to schedule jobs however, so this brings...
Hello,
I am VERY new to managing a SQL server database, although I'm an ASP programmer, all I've done is basically connected to one using ODBC. Any advice will have to be written as though you are talking to a complete novice.
I am currently setting up a website (hosted elsewhere) which will...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.