有二张表h和hh
h表数据如下:
 a
12.03
110.21hh表数据如下:
  b 
12.01
12.03
112.32

select h.a from h,hh where h.a=hh.b
结果
/*
12.03
*/
如果把hh的b字段数据类型改成money那怎么查询?

解决方案 »

  1.   

    不還一樣?
    create table h(a float)
    insert h 
    select 12.03 union all
    select 110.21create table hh(b money)
    insert hh 
    select 12.01 union all
    select 12.03 union all
    select 112.32
    select h.a from h,hh where h.a=hh.bdrop table h
    drop table hha                                                     
    ----------------------------------------------------- 
    12.029999999999999
      

  2.   

    select h.a from h,hh where cast(h.a as money)=hh.b是这个意思?
      

  3.   

    create table #h (
     a numeric(10,2))gocreate table #hh(
     b money,
    )
    goinsert into #h 
    select 12.03
    union all
    select 110.21go 
    insert into #hh
    select 12.01
    union all
    select 12.03
    union all
    select 112.32select #h.a from #h,#hh where #h.a=#hh.bdrop table #hh
    drop table #h
    ------------------------
    我的感觉是一样的呀!没有什么区别呀!
    --------------------------------------
    要不你用convert()转换一下.