MS SQL Server中Group_concat的替代方法

时间:2019-02-26 22:16:25

标签: mysql sql-server

我有一个简单的查询,可以很好地在SQL工作台中对concat进行分组。

class myApp extends React.PureComponent {

    render() {
        const { isConnected, isSignedIn, isSigningIn } = this.props;
        if (!isConnected || isSigningIn) {
            return <RouterStack />;
        } else if (isSignedIn) {
            return <RouterStack />;
        }
        return <Login />;
    }
}

myApp.propTypes = {
    isConnected: PropTypes.bool,
    isSignedIn: PropTypes.bool,
    isSigningIn: PropTypes.bool,
};

// if Meteor.something() is null, !!Meteor.something() is false
// if Meteor.something() is a valid object, !!Meteor.something() is true
export default createContainer(() => ({
    isConnected: !!Meteor.status().connected,
    isSignedIn: !!Meteor.user(),
    isSigningIn: !!Meteor.loggingIn(),  
}), myApp);

预期输出:

this.state = {
    services : [{service: "s1", value: false},
                {service: "s2", value: false},
                {service: "s3", value: false},
               ]
};

handleServiceCheck = (i) => {
    let services = this.state.services;
    services[i].value = !services[i].value;
    this.setState({ services: services });
};

this.state.services.map((service, i) => (
    <FormControlLabel key={i}
        control={
            <Checkbox
                checked={service.value}
                onChange={() => this.handleServiceCheck(i)}
                value={service.service}
                className={classes.checkBox}
            />
        }
        label={service.service}
    />
))

如何使用MS SQL Server获得此输出?

0 个答案:

没有答案