Èճ̰²ÅÅÉú³ÉµÄsqlÓï¾ä
select *
from
(select [id]=row_number() over (order by getdate()),
date=convert(varchar(8),dateadd(dd,number,'2010-01-01'),112)
from
(select number from master..spt_values where type='p' )t ) X
join
(select '1' as id, 'A' as Col1 union all
select '2' as id,'B' as Col1 union all
select '3' as id ,'C' as Col1
) Y
on x.id % ( select count(*) + 1
from ( select '1' as id union all
select '2' as id union all
select '3' as id ) M)
=y.id
order by x.id
Ïà¹ØÎĵµ£º
¶¯Ì¬Óï¾ä
1 :ÆÕͨSQLÓï¾ä¿ÉÒÔÓÃexecÖ´ÐÐ
Select * from tableName
exec('select * from tableName')
exec sp_executesql N'select * from tableName' -- Çë×¢Òâ×Ö·û´®Ç°Ò»¶¨Òª¼ÓN
2:×Ö¶ÎÃû£¬±íÃû£¬Êý¾Ý¿âÃûÖ®Àà×÷Ϊ±äÁ¿Ê±£¬±ØÐëÓö¯Ì¬SQL
declare @fname varchar(20)
set @fname = 'FiledName'
Select @fnam ......
Oracle µÄSQL*LOADER¿ÉÒÔ½«ÍⲿÊý¾Ý¼ÓÔص½Êý¾Ý¿â±íÖС£ÏÂÃæÊÇSQL*LOADERµÄ»ù±¾Ìص㣺
1£©ÄÜ×°È벻ͬÊý¾ÝÀàÐÍÎļþ¼°¶à¸öÊý¾ÝÎļþµÄÊý¾Ý
2£©¿É×°Èë¹Ì¶¨¸ñʽ£¬×ÔÓɶ¨½çÒÔ¼°¿É¶È³¤¸ñʽµÄÊý¾Ý
3£©¿ÉÒÔ×°Èë¶þ½øÖÆ£¬Ñ¹ËõÊ®½øÖÆÊý¾Ý
4£©Ò»´Î¿É¶Ô¶à¸ö±í×°ÈëÊý¾Ý
5£©Á¬½Ó¶à¸öÎïÀí¼Ç¼װµ½Ò»¸ö¼Ç¼ÖÐ
6£©¶ÔÒ»µ¥¼Ç¼·Ö½âÔÙ×°Èëµ½± ......
½ñÌìÎÒѧϰÁËsqlµÄ¼òµ¥²éѯÓï¾ä£¬
һЩ»ù±¾µÄ¸ÅÄ
1 ϵͳȨÏÞ£ºÊý¾Ý¿âÖеĶÔÏó£¬ ±í£¬´´½¨±í£¬É¾³ý±í
2 ¶ÔÏóȨÏÞ£º¶ÔÊý¾ÝµÄÔö¡¢É¾¡¢¸Ä¡¢²é¡ ......
ÎÒ½ñÌìѧϰÁËsqlÓï¾äµÄ³£Óú¯Êý£¬ÊÇ·ëÍþÀÏʦ½²µÄ£¬ÎÒ×öÁ˼òµ¥µÄ±Ê¼Ç£º
Ò»£¬SQLº¯Êý£º
1. ´óСдת»»º¯Êý
lower ת³ÉСд
upper ´óд
initcap ½«×Ö·û´®µÄ(ÿ¸öµ¥´ÊµÄ)µÚÒ»¸ö×Öĸ±äΪ´óд,ºóÃæµÄСд
select initcap('huangHY') from dual
&n ......
Ëù²âÊÔ»·¾³Îª£ºMs sqlserver 2008£¬visual studio 2008
²âÊÔÊý¾ÝΪ10ÍòÌõ
Linq·½Ê½ ´úÂ룺
/// <summary>
/// Linq ·½Ê½
/// </summary>
public static void Linq_insert()
{
DataClassesDataContext dataContext = new DataClassesDataContext();
......