首页 新闻 会员 周边

请教SQL2008里的搜索命令

0
悬赏园豆:10 [已解决问题] 解决于 2014-02-24 12:47

在SQL2008的某个表下面执行这个命令

SELECT TOP 2000 [KeyCode]
      ,[UniqueCode]
      ,[Share]
      ,[CertNo]
      ,[CertNoVerifyNo]
      ,[IDType]
      ,[IDNo]
      ,[IDStartDate]
      ,[IDEndDate]
      ,[IDIssueAuthority]
      ,[Name]
      ,[Sex]
      ,[BirthDate]
      ,[NativePlace]
      ,[Nationality]
      ,[Nation]
      ,[Address]
      ,[Telephone]
      ,[LegalPerson]
      ,[LegalType]
      ,[WorkingDepartment]
      ,[DepartmentNature]
      ,[SpauseName]
      ,[SpauseIDType]
      ,[SpauseIDNo]
      ,[SpauseWorkingDepartment]
      ,[Photo]
      ,[FingerPrint]
      ,[FingerPrintCode]
      ,[Remark]
      ,[Type]
      ,[ID]
      ,[Sequence]
      ,[OwnerRelationship]
      ,[FingerInfo]
      ,[IsPrint]
      ,[IsPrint2]
  FROM [EisAir].[dbo].[Owner]

 

会显示表单数据里面前2000条信息,如果我想搜索整个表单里 ,[CertNo]对应的特定内容,要怎么搜索并让其显示出来。或者说我想以,[CertNo]下面的内容以搜索条件,搜索显示出来上面命令里面的项目

 

是以 [CertNo]为搜索条件,比如 搜索 [CertNo]下面带20130056这个数字的有哪些,并显示出来

问题补充:

谢谢各位我已经可以查询到这行信息了,但是如果要编辑这行信息要输入什么命令呢。

新手笨笨都有的主页 新手笨笨都有 | 初学一级 | 园豆:186
提问于:2014-01-31 15:05
< >
分享
最佳答案
0
SELECT  [KeyCode]
      ,[UniqueCode]
      ,[Share]
      ,[CertNo]
      ,[CertNoVerifyNo]
      ,[IDType]
      ,[IDNo]
      ,[IDStartDate]
      ,[IDEndDate]
      ,[IDIssueAuthority]
      ,[Name]
      ,[Sex]
      ,[BirthDate]
      ,[NativePlace]
      ,[Nationality]
      ,[Nation]
      ,[Address]
      ,[Telephone]
      ,[LegalPerson]
      ,[LegalType]
      ,[WorkingDepartment]
      ,[DepartmentNature]
      ,[SpauseName]
      ,[SpauseIDType]
      ,[SpauseIDNo]
      ,[SpauseWorkingDepartment]
      ,[Photo]
      ,[FingerPrint]
      ,[FingerPrintCode]
      ,[Remark]
      ,[Type]
      ,[ID]
      ,[Sequence]
      ,[OwnerRelationship]
      ,[FingerInfo]
      ,[IsPrint]
      ,[IsPrint2]
  FROM [EisAir].[dbo].[Owner]
  Where [CertNo]='20130056'

 


 

收获园豆:10
+小马哥++ | 小虾三级 |园豆:906 | 2014-02-12 16:45

编辑就用update啊。

比如update [EisAir].[dbo].[Owner] set type='123',photo='456' where certNo='20130056'

+小马哥++ | 园豆:906 (小虾三级) | 2014-02-19 08:58
其他回答(2)
0

如果是想显示全部   去掉top 2000 就可以了

 [CertNo]对应的特定内容 是说以CerNo作为搜索条件还是啥?

mushishi | 园豆:230 (菜鸟二级) | 2014-02-05 14:46

是的 是以 [CertNo]为搜索条件,比如 搜索 [CertNo]下面带20130056这个数字的有哪些,并显示出来

支持(0) 反对(0) 新手笨笨都有 | 园豆:186 (初学一级) | 2014-02-07 10:08
0

最后加上一个where  [CertNo] = *****  就可以了

JAvaC+ | 园豆:202 (菜鸟二级) | 2014-02-14 23:56
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册