matlab中sql语句带有变量怎么写
1、第一步我们定义一个字符串变量startTime='2018-07-01',衡痕贤伎sql语句data=exec(conn, [&垆杪屑丝#39;select * from coal_storage where time>=''',startTime,'''']);如下图所示:

3、第三步我们也可以定义两个变量,startTime和endTime,sql语句data=exec(conn, 缪梨痤刻['select * from coal_storage where time>=''',startTime,''' and time<=''',endTime,'''']);如下图所示:

5、第五步需要注意的是matlab中sql语句带有变量需要加[],不带变量可以直接使用单引号'',我们可以看一下带变量没有[]的情况,如下图所示:
