怎么样才能在模板数据集中写select * from 数组

本帖最后由 jsl8071808 于 2016-7-6 13:11 编辑

FR的多级上报,每个人写的备注,最终在数据库里存成了一个数组,如下:
[{"time":"2016-07-01 10:40:53","nodeIdx":0,"message":"已填","user":"曹琳(caolin)"},{"time":"2016-07-01 10:41:48","nodeIdx":0,"message":"已填","user":"陈杰(chenjie)"},{"time":"2016-07-01 10:43:09","nodeIdx":1,"message":"退回测试","user":"许光(xuguang)"},{"time":"2016-07-01 10:47:52","nodeIdx":2,"message":"试试","user":"曹琳(caolin)"},{"time":"2016-07-01 10:47:13","nodeIdx":2,"message":"试试","user":"陈杰(chenjie)"},{"time":"2016-07-01 10:48:19","nodeIdx":3,"message":"试试","user":"许光(xuguang)"},{"time":"2016-07-01 10:49:02","nodeIdx":4,"message":"试试","user":"陈杰(chenjie)"},{"time":"2016-07-01 10:49:30","nodeIdx":5,"message":"通过","user":"许光(xuguang)"}]

我想在模板数据集中用这个数组,写成select * from [{"time":"2016-07-01 10:40:53","nodeIdx":0,"message":"已填","user":"曹琳(caolin)"},{"time":"2016-07-01 10:41:48","nodeIdx":0,"message":"已填","user":"陈杰(chenjie)"},{"time":"2016-07-01 10:43:09","nodeIdx":1,"message":"退回测试","user":"许光(xuguang)"},{"time":"2016-07-01 10:47:52","nodeIdx":2,"message":"试试","user":"曹琳(caolin)"},{"time":"2016-07-01 10:47:13","nodeIdx":2,"message":"试试","user":"陈杰(chenjie)"},{"time":"2016-07-01 10:48:19","nodeIdx":3,"message":"试试","user":"许光(xuguang)"},{"time":"2016-07-01 10:49:02","nodeIdx":4,"message":"试试","user":"陈杰(chenjie)"},{"time":"2016-07-01 10:49:30","nodeIdx":5,"message":"通过","user":"许光(xuguang)"}]

系统显示错误,正确的写法和解决方法是什么呢

FineReportjsl8071808 发布于 2016-7-6 13:06
回答问题
悬赏:2 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共4回答
最佳回答
0
boy51job发布于2016-7-6 14:00(编辑于 2023-9-6 09:34)
555
最佳回答
0
jsl8071808发布于2016-7-6 14:17(编辑于 2023-9-6 09:34)
555
  • 71380444 71380444


    select * from (select note from FR_PROCESS_TASK_IMPL where FRTASKID=${fr_task_ID})
    只用在这个语句后加一个别名,如\"a\"就可以解决
    select * from (select note from FR_PROCESS_TASK_IMPL where FRTASKID=${fr_task_ID}) a

    回复
    2016-07-07 17:01 
  • yets11 yets11
    FR_PROCESS_TASK_IMPL表中不存在note字段,当然会报错了
    方法是建一个数据集,连接一下FR_PROCESS_TASK_IMPL这个表,即
    SELECT * FROM PUBLIC.FR_PROCESS_TASK_IMPL,看看备注存在哪个字段

    然后前面把note改成相应的字段就可以了

    如select operatorjson from FR_PROCESS_TASK_IMPL where FRTASKID=${fr_task_ID})

    [attach]40215[/attach]
    [attach]40216[/attach]
    回复
    2016-07-21 08:02 
最佳回答
0
71380444发布于2016-7-7 17:01(编辑于 2023-9-6 09:34)
555
最佳回答
0
yets11发布于2016-7-21 08:02(编辑于 2023-9-6 09:34)
555
  • 0关注人数
  • 1019浏览人数
  • 最后回答于:2016-7-21 08:02
    活动推荐 更多
    热门课程 更多
    返回顶部