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 |
Kalaiselvan
Posting Yak Master
112 Posts |
Posted - 2013-08-13 : 01:27:40
|
Hi, I have gone thru some SQL Websites for SQL Bulk Data Transaction. There I have got some Query, And I have tried using that. But Stucked with DISTRIBUTED BY Keyword. Need to know about Distributed Method in SQL and the Below Query Usage.. Table [trans_data][Order_Id][ITEM] order 1 item 1 order 1 item 2 order 1 item 32 order 2 item 3 order 2 item 2 order 2 item 5 order 3 item 3CREATE TABLE Trans_01 AS SELECT item, SUM(1) AS cntFROM trans_data GROUP BY itemHAVING SUM(1) > 5DISTRIBUTED BY (item)The above query getting an error with Incorrect syntax near the keyword 'DISTRIBUTED'. Please help to Learn about Distributed in SQL server and above Query Usage.Regards,Kalai |
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2013-08-13 : 10:47:14
|
I've never seent that syntax and I don't think it is valid in SQL Server. Do you have a link for where you saw this syntax? |
|
|
Kalaiselvan
Posting Yak Master
112 Posts |
Posted - 2013-08-14 : 00:22:39
|
http://picksesame.blogspot.in/2011/01/market-basket-analysis-using-sql.htmlRegards,Kalai |
|
|
djj55
Constraint Violating Yak Guru
352 Posts |
Posted - 2013-08-14 : 09:00:16
|
Remember T-SQL does not use all the same commands as SQL.djj |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2013-08-14 : 15:58:09
|
quote: DISTRIBUTED BY (column, [ ... ] )DISTRIBUTED RANDOMLYUsed to declare the Greenplum Database distribution policy for the table. DISTIBUTED BY uses hash distribution with one or more columns declared as thedistribution key. For the most even data distribution, the distribution key should be the primary key of the table or a unique column (or set of columns). If that is notpossible, then you may choose DISTRIBUTED RANDOMLY, which will send the data round-robin to the segment instances. If not supplied, then hash distribution ischosen using the PRIMARY KEY (if the table has one) or the first eligible column of the table as the distribution key.
Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2013-08-14 : 16:00:56
|
http://media.gpadmin.me/wp-content/uploads/2011/05/GP-4100-AdminGuide.pdfIt seems DISTRIBUTED BY has the equivalent in Microsoft SQL Server (T-SQL) with " OPTION (HASH GROUP). " Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA |
|
|
|
|
|
|
|