We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dble version: 3.21.10.0
configs:
sharding.xml
<shardingTable name="Employee" shardingNode="dn3,dn4" function="func_hashString" shardingColumn="deptname"/> <function name="func_hashString" class="StringHash"> <property name="partitionCount">2</property> <property name="partitionLength">1</property> <property name="hashSlice">0:2</property> </function>
CREATE TABLE `Employee` ( `name` varchar(250) NOT NULL, `empid` int(11) NOT NULL, `deptname` varchar(250) NOT NULL, `level` varchar(250) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
step2. prepare data:
insert into Employee values('Harry',3415,'Finance','P7'),('Sally',2242,'Sales','P7'),('George',3401,'Finance','P8'),('Harriet',2202,'Sales','P8'),('Mary',1257,'Human Resources','P7'),('LiLi',9527,'Human Resources','P9'),('Tom',7012,'Market','P9'),('Tony',3052,'Market','P10'),('Jessi',7948,'Finance','P8');
step3. execute SQL:
select deptname,count(*) from Employee group by deptname='Human Resources';
+-----------------+----------+ | deptname | count(*) | +-----------------+----------+ | Finance | 7 | | Human Resources | 2 | +-----------------+----------+
+-----------------+----------+ | deptname | count(*) | +-----------------+----------+ | Sales | 7 | | Human Resources | 2 | +-----------------+----------+
The text was updated successfully, but these errors were encountered:
No branches or pull requests
dble version:
3.21.10.0
configs:
sharding.xml
step1. create table:
step2. prepare data:
step3. execute SQL:
The text was updated successfully, but these errors were encountered: