SELECT col1 , tempstr ,col3 , CASE col4 WHEN '0' THEN '你的说明1' WHEN '1' THEN '你的说明2' WHEN '2' THEN '你的说明3' WHEN '3' THEN '你的说明4' END AS name1, FROM table1 join table2 on tabel1.col2 = table2.id如上写你的sql语句然后把它fill到dataset 再绑定到datagrid中就可以拉!那个要根据不同值显示不同说明的绑定列为name1(你起的名字)
SELECT t1.col1,t2.tempstr,t1.col3,case col4 from table1 t1 inner join table2 t2 on t1.col2 = t2.id
建立一个VIEW然后从这个View中得到数据,你会发现OK了
col1 int 我取出后用加上一个常量字符串"abc"+col1作为显在datagrid列上,请问如何操作!
SELECT a.*,COUNT(b.isread) AS readed, COUNT(b.RMAstrid)-COUNT(isread) AS notreaded FROM ( SELECT a.RMAstrid,a.applydate,a.RMAid, COUNT(b.RMAstrid) AS quantity ,SUM(ISNULL(b.cost,0)) as costFROM tblRMA a INNER JOIN tblRMAItem b ON a.RMAstrid=b.RMAstrid GROUP BY a.RMAstrid,a.applydate,a.RMAid ) a INNER JOIN tblRMAMessage b ON a.RMAstrid=b.RMAstrid GROUP BY a.RMAstrid,a.applydate,a.RMAid,a.quantity,a.cost
深表歉意,我写错了,更正如下 SELECT t1.col1,t2.tempstr,t1.col3,case col4 when '0' then '零' when '1' then '一' when '2' then '二' when '3' then '三' end from table1 t1,table2 t2 where t1.col2=t2.id
CASE col4 WHEN '0' THEN '你的说明1' WHEN '1' THEN '你的说明2' WHEN '2' THEN '你的说明3' WHEN '3' THEN '你的说明4' END AS name1,
FROM table1 join table2 on tabel1.col2 = table2.id如上写你的sql语句然后把它fill到dataset 再绑定到datagrid中就可以拉!那个要根据不同值显示不同说明的绑定列为name1(你起的名字)
on t1.col2 = t2.id
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
String col = DataBinder.Eval(e.Item.DataItem, "col1").ToString();
e.Item.Cells[5].Text="abc"+col1";
}
FROM
(
SELECT a.RMAstrid,a.applydate,a.RMAid,
COUNT(b.RMAstrid) AS quantity ,SUM(ISNULL(b.cost,0)) as costFROM tblRMA a INNER JOIN tblRMAItem b ON a.RMAstrid=b.RMAstrid GROUP BY
a.RMAstrid,a.applydate,a.RMAid
) a
INNER JOIN tblRMAMessage b ON a.RMAstrid=b.RMAstrid
GROUP BY a.RMAstrid,a.applydate,a.RMAid,a.quantity,a.cost
SELECT t1.col1,t2.tempstr,t1.col3,case col4 when '0' then '零' when '1' then '一' when '2' then '二' when '3' then '三' end from table1 t1,table2 t2 where t1.col2=t2.id