SQLSERVER newId()

SELECT ID,NewsType,Title,inputDate,hitcounter,sources
FROM cv_other.dbo.Hr_Newscontent


SELECT ID,NewsType,Title,inputDate,hitcounter,sources FROM cv_other.dbo.Hr_Newscontent where 1=1  order by inputdate desc


SELECT NewTypeID, NewTypeName FROM cv_Other.dbo.Dic_HrNewsType
WHERE newTypeID LIKE '%'
ORDER BY NewTypeID ASC

 

select q.referenceId, q.questionName, q.questionType
from cv_other.dbo.Hr_Questionnaire q
where q.referenceId =
(
select max(q.referenceId) qid
from cv_other.dbo.Hr_Questionnaire q
where q.isValid = 1
)

 

select refId,loginType,userId,coins,giftCoins,ip,remark,updateDate
from gk.dbo.CoinsLog
where resId>0 and productId=3 and operFlag=1

select loginType,count(1) num
from gk.dbo.CoinsLog
where resId>0 and productId=3 and operFlag=1
group by loginType

 select loginType,count(1) num
 from gk.dbo.CoinsLog
 where resId>0 and productId=3 and operFlag=1 and updateDate>='2011-03-22 00:00:00.001' and updateDate<='2013-03-20 23:59:59.999'
 group by loginType


select * 
 from gk.dbo.CoinsLog
 where loginType=2 and resId>0 and productId=3 and operFlag=1 and updateDate>='2011-03-22 00:00:00.001' and updateDate<='2013-03-20 23:59:59.999'

 group by loginType

select referenceId,questionName,questionType,startTime,endTime,isValid from cv_other.dbo.Hr_Questionnaire

select questionId,answerContent,times from cv_other.dbo.Hr_QuestionAnswer

select top 100 * from cv_other.dbo.Hr_Newscontent order by newId()

select a.ID, a.NewsType,b.newTypeName,a.Title, a.Smallcontent, a.Content, a.Isfocus, a.inputDate, a.hitcounter, a.DelFlag, a.provider, a.address, a.DocFileName, a.BossFlag, a.bigIcon, a.minIcon, a.reads, a.supports
from  cv_other.dbo.hr_newsContent a
join cv_other.dbo.dic_hrnewstype b on(a.NewsType = b.newTypeId)
order by newId() 


select *
from gk..users


select *
from cv_other.dbo.dic_hrnewstype


select min(id),max(id) from cv_other.dbo.Hr_Newscontent

select newid()

INSERT INTO [cv_other].[dbo].[Hr_QuestionAnswer]
           ([questionID]
           ,[answerContent]
           ,[times])
     VALUES
           (<questionID, int,>
           ,<answerContent, varchar(200),>
           ,<times, int,>)

INSERT INTO

 

update cv_other..Hr_Questionnaire set questionName=?,questionType=?,startTime=?,endTime=?,isValid=? where referenceId=?;
update cv_other..Hr_QuestionAnswer set answerContent=? where questionId=? and referenceId=?;
update cv_other..Hr_QuestionAnswer set answerContent=? where questionId=? and referenceId=?;
update cv_other..Hr_QuestionAnswer set answerContent=? where questionId=? and referenceId=?;
insert cv_other..Hr_QuestionAnswer(questionId,answerContent,times) values (?,?,?);

[规范地方的, 1, 2013-03-22, 2013-03-26, 1, 2,
3, 2, 4,
4个, 2, 5,
 88, 2, 6,
2, 999, 0]

 

 


INSERT INTO [cv_other].[dbo].[Hr_Questionnaire]
           ([questionName]
           ,[questionType]
           ,[startTime]
           ,[endTime]
           ,[isValid])
     VALUES
           (<questionName, varchar(200),>
           ,<questionType, tinyint,>
           ,<startTime, smalldatetime,>
           ,<endTime, smalldatetime,>
           ,<isValid, bit,>)

你可能感兴趣的:(SQLSERVER newId())