关于交叉查询语句中 IMAGE字段的问题 再问。
lsj2 2006-08-24 06:24:50 由于报表输出要用到交叉查询语句, 我是这样写的:
select medID,
Image1=(case imageid when 1 then imagedata end),
Image2=(case imageid when 2 then imagedata end),
....
from images
where medID=1
group by medID
imagedata是image类型.
报错:imagedata不包含在任何聚合函数中.
有人给出如下方法:
select medID,
Image1=max(cast( (case imageid when 1 then imagedata end) as binary)), --或者binary(8000)
Image2=max(cast( (case imageid when 2 then imagedata end) as binary)),
....
from images
where medID=1
group by medID
测试语法没有错,但得到的图像数据不对,显示不出来。 该如何写才能得到准确的图像数据?