我指定了表名还是提示 列名 'NAME' 不明确。求大神解答
以下是SQL代码:
<![CDATA[
select * from (select row_.*, ROW_NUMBER()over(order by row_.id desc) rownum_ from (
]]>
select TOP 100 PERCENT siteUser.ID,siteUser.NAME,siteUser.GENDER,siteUser.BIRTHDAY,siteUser.POLITICAL,siteUser.NATION,siteUser.TITLE,siteUser.PDA,siteUser.RADIO,siteUser.OTHER,siteUser.PHONE,siteUser.PHOTO,siteUser.SITEID,site.NAME SITE_NAME
from SYS_SITE_USER siteUser left join SYS_SITE site
on siteUser.SITEID = site.ID
<where>
<include refid = "other-condition"/>
</where>
order by id
<![CDATA[
)row_ )t where t.rownum_ between #{startrow} and #{endrow}
]]>
<sql id="other-condition">
<if test="name != null"> and NAME like #{name,javaType=String}</if>
<if test="gender != null"> and GENDER = #{gender,javaType=String}</if>
<if test="birthday != null"> and BIRTHDAY = #{birthday,javaType=Date}</if>
<if test="political != null"> and POLITICAL = #{political,javaType=String}</if>
<if test="nation != null"> and NATION = #{nation,javaType=String}</if>
<if test="title != null"> and TITLE = #{title,javaType=VARCHAR}</if>
<if test="pda != null"> and PDA = #{pda,javaType=String}</if>
<if test="radio != null"> and RADIO = #{radio,javaType=String}</if>
<if test="other != null"> and OTHER = #{other,javaType=String}</if>
<if test="phone != null"> and PHONE = #{phone,javaType=String}</if>
<if test="photo != null"> and PHOTO = #{photo,javaType=String}</if>
<if test="siteId != null"> and SITEID = #{siteId,javaType=Integer}</if>
<if test="siteName != null"> and SITE_NAME = #{siteName,javaType=String}</if>
</sql>
<![CDATA[
select * from (select row_.*, ROW_NUMBER()over(order by row_.id desc) rownum_ from (
]]>
select TOP 100 PERCENT siteUser.ID,siteUser.NAME,siteUser.GENDER,siteUser.BIRTHDAY,siteUser.POLITICAL,siteUser.NATION,siteUser.TITLE,siteUser.PDA,siteUser.RADIO,siteUser.OTHER,siteUser.PHONE,siteUser.PHOTO,siteUser.SITEID,site.NAME SITE_NAME
from SYS_SITE_USER siteUser left join SYS_SITE site
on siteUser.SITEID = site.ID
<where>
<include refid = "other-condition"/>
</where>
order by id
<![CDATA[
)row_ )t where t.rownum_ between #{startrow} and #{endrow}
]]>
<sql id="other-condition">
<if test="name != null"> and NAME like #{name,javaType=String}</if>
<if test="gender != null"> and GENDER = #{gender,javaType=String}</if>
<if test="birthday != null"> and BIRTHDAY = #{birthday,javaType=Date}</if>
<if test="political != null"> and POLITICAL = #{political,javaType=String}</if>
<if test="nation != null"> and NATION = #{nation,javaType=String}</if>
<if test="title != null"> and TITLE = #{title,javaType=VARCHAR}</if>
<if test="pda != null"> and PDA = #{pda,javaType=String}</if>
<if test="radio != null"> and RADIO = #{radio,javaType=String}</if>
<if test="other != null"> and OTHER = #{other,javaType=String}</if>
<if test="phone != null"> and PHONE = #{phone,javaType=String}</if>
<if test="photo != null"> and PHOTO = #{photo,javaType=String}</if>
<if test="siteId != null"> and SITEID = #{siteId,javaType=Integer}</if>
<if test="siteName != null"> and SITE_NAME = #{siteName,javaType=String}</if>
</sql>
...全文
相关推荐
Python CSV宽表转长 melt 日均与门店合计
Python CSV宽表转长 melt 日均与门店合计 把门店×日期宽表 melt 成长表,输出日均销量柱状图和门店合计条形图。可传入自己的 CSV。 功能: · 宽表 melt 成长表 · 按日均柱状 · 门店合计条形 · 导出 long.csv · 可传入自己的 CSV · 打包时预跑 output/preview 压缩包含可运行源码、依赖与说明,按 README 安装后即可复现。
DB2错误代码提示
在编译DB2的时候报错的代码翻译,在ssh中控制台报错你可以很快的查找出错误代码对应的意思。
SqlServer给表增加多个字段的语法
主要介绍了SqlServer给表增加多个字段的语法,添加字段的语法非常简单,需要的朋友参考下本文吧
经典sql语句(含题目及分析解答)
整理几年来收集的经典sql语句,有问题描述和解答及分析过程
多表查询的练习
多表查询练习


