请教一个问题:
declare @cust table
(
Id int IDENTITY(1,1) NOT NULL,
Rateid int,
custId int
)
这个table有18000多个记录。
create table #rate
(
CustId int,
RateID int,
RateTypeId int,
EffectiveDate datetime,
ExpirationDate Datetime,
OrderIndex int
)
这个table有92000个记录,可是下面这个loop就很慢(要3-4分钟):
select @count=COUNT(1)
from @cust
--------这个loop是找到每一个Cust Id的Rate Type IDs
while(@index<=@count)
begin
set @result=''
set @custid=0
select @custid= custId from @cust ... 阅读全帖
SQL 2008?
use MERGE
example:
MERGE INTO dbo.Customers AS TGT
USING dbo.CustomersStage AS SRC
ON TGT.custid = SRC.custid
WHEN MATCHED AND TGT.companyname <> SRC.companyname THEN
UPDATE SET
TGT.companyname = SRC.companyname,
TGT.phone = SRC.phone,
TGT.address = SRC.address
WHEN NOT MATCHED THEN
INSERT (custid, companyname, phone, address)
VALUES (SRC.custid, SRC.companyname, SRC.phone, SRC.address)
WHEN NOT MATCHED BY SOURCE THEN
DELETE
OUTPUT
$action, deleted.custid AS de
If custid, productid is not unique in sales table. Change the query to:
select custid
from sales
group by custid
having count(distinct productid) = (select count(productid) from product)
不用count,
select distinct custid from sale s1 where not exists ( select 1 from sale
s2 right join prod p on s2.pid = p.pid and s1.custid = s2.custid where s2.
pid is null)
I would like to build up a data mining model in SQl server 2008 R2 on win 7.
This is my code:
CREATE MINING STRUCTURE [People1]
(
[CustID] LONG KEY,
[Name] TEXT DISCRETE,
[Gender] TEXT DISCRETE,
[Age] LONG CONTINUOUS,
[CarMake] TEXT DISCRETE,
[CarModel] TEXT DISCRETE
)
GO
In Microsoft SQL server management studio, I got error:
Unknown object type 'MINING' used in a CREATE, DROP, or ALTER statement.
Did I need to inst... 阅读全帖
【 以下文字转载自 JobHunting 讨论区 】
发信人: light009 (light009), 信区: JobHunting
标 题: set up data mining model in SQl server 2008 win 7
发信站: BBS 未名空间站 (Sat Jun 28 20:07:07 2014, 美东)
I would like to build up a data mining model in SQl server 2008 R2 on win 7.
This is my code:
CREATE MINING STRUCTURE [People1]
(
[CustID] LONG KEY,
[Name] TEXT DISCRETE,
[Gender] TEXT DISCRETE,
[Age] LONG CONTINUOUS,
[CarMake] TEXT DISCRETE,
[CarModel] TEXT ... 阅读全帖
Parameters are passed in the query string sent to the server side,
such as http://localhost:9086/AppOn/order.do?OrderId=10000&custId=90000
It calls doGet() method to process the http request.
My question is there any disadvantage of doing that except that the length has the limitation of 250 characters-long and no confidential information?
Thanks a lot for your reply.
【 以下文字转载自 JobHunting 讨论区 】
发信人: light009 (light009), 信区: JobHunting
标 题: set up data mining model in SQl server 2008 win 7
发信站: BBS 未名空间站 (Sat Jun 28 20:07:07 2014, 美东)
I would like to build up a data mining model in SQl server 2008 R2 on win 7.
This is my code:
CREATE MINING STRUCTURE [People1]
(
[CustID] LONG KEY,
[Name] TEXT DISCRETE,
[Gender] TEXT DISCRETE,
[Age] LONG CONTINUOUS,
[CarMake] TEXT DISCRETE,
[CarModel] TEXT ... 阅读全帖