首页  |  新闻  |  天气  |  联系我们  |  管理登陆 
逸飞和逸翔 家庭百事 科技纵横 家庭影集 网络文摘 音乐&艺术 友情链结
Business
中国瓷器
Computer/Internet
ASP/VB
SQL server
FLASH
Home Network
IIS SERVER
photoshop
search engine
Perl
General Problem Fix
Powerpoint
Router/Switch/Hub
Excel
FTP
.NET
Internet Security
Cloud Computing
GPG
PHP
语义搜索(semantic search)
股票
Glossaries
IPHONE
Books
 
Send to printer

1. Find account information that in customer table but not exist in another table

SELECT  Acctno, BTState
From rittenhouse_customer
Where acctno NOT IN (
  Select cust.acctno from rittenhouse_customer cust, temp_account acct
WHERE    cust.acctno = acct.acctno )

another way -

Select rc.acctno, rc.Acctname, rc.BTState, rc.BTZIP from rittenhouse_customer rc LEFT JOIN rittenhouse_cust_profile rcf
on (rc.acctno = rcf.acctno)
Where rcf.acctno IS NULL
order by rc.BTState

 

2.Find duplicates

SELECT     sku, COUNT(*) AS Expr1
FROM         rittenhouse_products_1
GROUP BY sku
HAVING      (COUNT(*) > 1)

3. BCP and update to a table

delete from rittenhouse_products_1
go
BULK INSERT Rittenhouse..rittenhouse_products_1 FROM 'c:\dataimport\RittenhouseInventory.txt'
WITH (
   CHECK_CONSTRAINTS,
   DATAFILETYPE = 'char',
   FIELDTERMINATOR = '~',
   ROWTERMINATOR = '\n'
)
go
--update rittenhouse_products_1, multiple 100 for price
update rittenhouse_products_1
set list_price = list_price * 100
, NetPrice = NetPrice * 100
go

 

back to top