易截截图软件、单文件、免安装、纯绿色、仅160KB

下面的SQL语句怎么写?

if()--这里判断A表中Code字段中的记录是否包含字符串USD?是在中间还是末尾??该怎么写
begin
select UserInfoId,Code,TradeCount,Code,
(isnull((select top 1 Price from hangqing.dbo.WH_Ticks where substring(StockSymbol,3,len(StockSymbol)-2)=A.Code order by [Time] desc),0) as nowPrice-CBPrice) * TradeType*10000*TradeCount/nowPrice AS FloatYingKui
from Moni_Exchange A 
where UserInfoId=@userid
end

else
begin
select UserInfoId,Code,TradeCount,Code,
(isnull((select top 1 Price from hangqing.dbo.WH_Ticks where substring(StockSymbol,3,len(StockSymbol)-2)=A.Code order by [Time] desc),0)-CBPrice) * TradeType*10000*TradeCount AS FloatYingKui
from Moni_Exchange A 
where UserInfoId=@userid
end
SQL code:
if exists(select 1 from a where code like '%_USD_%' ) --中间
if exists(select 1 from a where code like '%USD' )-- 末尾


SQL code:
if exists(select 1 from a where code like '%USD%' ) --中间
if exists(select 1 from a where code like '%USD' )-- 末尾


楼上的没明白我的意思

if(right(A.code,3)='USD')
begin
--单笔合约浮动盈亏(美元)2(间接标价货币:如欧元|美元 浮动盈亏=(最新平仓价-开仓价)×买卖方向参数×10000×手数
s


相关问答:

sql小小的疑问 - .NET技术 / C#

可能因为工作的原因 接触数据库这块比较少,之前都是做程序这块,数据库这块都有专门的人来做 分工都很明细 所以对数据库这一块完全不了解。前段时间 去面试了几家公司 几乎都是在数据库这块挂掉的 连个简单的SQ ......

ASP链接SQL的简单登陆界面 - .NET技术 / ASP.NET

protected void btnLogin_Click(object sender, EventArgs e)
  {
  SqlConnection conn = new SqlConnection("Server = (local);user id = sa;pwd = 1;database = Login");
&nb ......

求一SQL - MS-SQL Server / 基础类

tab1 字段:billdate,goodsid,incount,inmoney,outcount,outmoney,endprice,endcount,endamt
tab2 字段:goodsid,goodskind(商品类型)
tab3 字段:goodskind(商品类型),kindname
结果:
得到商品类型在一段时间 ......

如何使用MySQL - MS-SQL Server / 基础类

刚刚接触MySQL,不知道该如何去查看数据,插入数据,创建数据库、表,用哪为前辈能指教一二?

MySQL 5.1参考手册

引用
兄弟你会结贴吗?
mysql 参考手册

baidu

MySQL官方文档 http://dev.mysql.com/doc ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号