ÇóÒ»sql£¿
SQL code:
--ÎÒµÄÒ»¸ö×Ö¶ÎΪֵΪNull
select * from table ORDER by type asc
--ÕâÊÇ type ÓпյÄ
-- »¹ÓÐNull
ÎÒÔõôÓÐÌõ¼þץȡֵNullµÄ¼ÇÂ¼ÄØ£¿
SQL code:
select * from table
where type is null
ORDER by type asc
where type is null
SQL code:
select * from table where type is null
ORDER by type asc
select * from table where type is not null ORDER by type asc
select * from table where type = '' or type is null ORDER by type asc
SQL code:
select * from tb where type is null order by type asc
SQL code:
select * from tb where type is null order by type desc
typeÊÇnull£¬ÄÇôºóÃæ
Ïà¹ØÎÊ´ð£º
select convert(varchar(50),cast(convert(numeric(18,2),1275674000000/100000000)as real))+'ÒÚ'
select cast(convert(numeric(18,2),1275674000000/100000000)as real)
ΪʲôÉÏÒ»¸öÓÃvarcharת»»ºó¾ÍÖ»±£ÁôÁËÒ ......
ÎÒÒ»¸öÏîÄ¿£¬Óиö²åÈë²Ù×÷£¬¾ßÌåÊÇÕâÑùµÄ£º
ÎÒÓнø»õÐÅÏ¢±í¡£ÔÚ³ö»õʱѡÔñÏàÓ¦µÄ½ø»õÐÅÏ¢£¬ÊäÈëÊýÁ¿£¬Ñ¡Ôñ²¿Ãź󣬵㱣´æ°´Å¥£¬ÓÉÓÚÍøÂçÑÓʱ£¬µãÒ»ÏÂûÓз´Ó³£¬ÓÚÊÇÓû§¾ÍÓÖµãһϣ¬µ¼ÖÂÒ»´Î²åÈëÁËÁ½Ìõ¼Ç¼:
Àý£º
......
OracleÖÐSQLÓï¾äÖÐ
drop table ±íÃû cascadeconstraints
Óë
drop table ±íÃû cascadeconstraint
ÓÐÊ²Ã´Çø±ð£¿
constraintºÍconstraintsÔÚoracleÖÐÊÇÒ»ÑùʹÓõÄ
¹Ù·½½¨ÒéʹÓÃconstraint
ÒýÓÃ
constraintºÍc ......
--drop table #T1
--drop table #T2
create Table #T1(ID int,
QueryID nvarchar(20),
ResultID1 nvarchar(20),
ResultID2 nvarchar(20))
create Table #T2(SortNo int,
QueryID nvarchar(20),
ResultID1 nv ......
Id Name Flag
1 ÕÅÈý 1
2 ÍõÎå 3
3 ÕÅÈý 1
4 ÀîËÄ 2
5 ÕÅÈý 1
6 ÀîËÄ 2
ÎÒÏëÊä³öµÄʱºò±ä³ÉÕâÑù
Id Name Flag
1 ÕÅÈý 1 & ......