select distinct ID,u_id ,U_Name,Pass from table
Group by u_id
Group by u_id
解决方案 »
- 求救delphi中显示sqlserver中image字段数据的问题
- 为什么会出现 Connection is busy whith result for another hstmt???
- 茫茫网海中,期待着我心中的那个他帮我帮我解解 "心头之恨"----事件、消息
- 用creatprocess打开了一个EXE遇到的问题!
- 有关 pb 调用 delphi dll 的问题!!!!!!纯粹送分
- 如何判断Edit控件是否有输入和没有输入?急!!!
- DBLookupComboBox控件怎么用----在线等
- 问题很急:关于连续拨号的问题
- Delphi 窗体闪烁
- 谁能告诉我??我该怎么做?
- 几个关于DELPHI的小问题
- 在paradox中,怎样判断字段该使用什么类型?这些类型应该怎写才合法?如时间,日期,number
where A.U_ID In
(select distinct u_id from table B)
where id in (select max(id) from tableA group by u_id)
我只能用临时表做.你可以调用存储过程得到数据.select * into #temp1
from table
where 1=2 //目的是为了得出一个空临时数据表insert #temp1(U_ID,U_Name,Pass)
select distinct u_id,'',''
from tableupdate #temp1 set a.u_name=b.u_name,a.pass=b.pass
from #temp1 a,table b
where a.u_id=b.u_idselect * from #temp1//drop table #temp1
select U_ID from table
group by U_ID
having count(A)=1那么想找出所有的记录值,可以这么写
select * from table where u_id in (select U_ID from table
group by U_ID having count(A)=1)
Group by u_id 根本行不通!select * from table A
where A.U_ID In
(select distinct u_id from table B)
又错误的理解了我的意思。只有一张表靠
select * from tableA
where id in (select max(id) from tableA group by u_id)
果来好使,谢了KingSunShaafeisky和txinfo的还没有试过,以上各位谢了