Ëæ»úÑ¡ÔñÐеÄSQLÓï¾ä? ORACLE SQLSERVER ECT.
MySQL:
SELECT column from table
ORDER BY RAND()
LIMIT 1
PostgreSQL:
SELECT column from table
ORDER BY RANDOM()
LIMIT 1
Microsoft SQL Server:
SELECT TOP 1 column from table
ORDER BY NEWID()
IBM DB2
SELECT column, RAND() as IDX
from table
ORDER BY IDX FETCH FIRST 1 ROWS ONLY
Thanks Tim
Oracle:
SELECT column from
( SELECT column from table
ORDER BY dbms_random.value )
WHERE rownum = 1
Thanks Mark Murphy
Feel free to post other example, variations, and SQL statements for other database servers in the comments.
Ïà¹ØÎĵµ£º
oracle±í¿Õ¼ä²Ù×÷Ïê½â
1
2
3×÷Õߣº À´Ô´£º ¸üÐÂÈÕÆÚ£º2006-01-04
5
6
7½¨Á¢±í¿Õ¼ä
8
9CREATE TABLESPACE data01
10DATAFILE '/ora ......
´¥·¢Æ÷ÊÇÒ»ÖÖÌØÊâµÄ´æ´¢¹ý³Ì£¬ËüÔÚ²åÈ룬ɾ³ý»òÐÞ¸ÄÌØ¶¨±íÖеÄÊý¾Ýʱ´¥·¢Ö´ÐУ¬Ëü±ÈÊý¾Ý¿â±¾Éí±ê×¼µÄ¹¦ÄÜÓиü¾«Ï¸ºÍ¸ü¸´ÔÓµÄÊý¾Ý¿ØÖÆÄÜÁ¦¡£Êý¾Ý¿â´¥·¢Æ÷ÓÐÒÔϵÄ×÷Óãº
¡¡¡¡* °²È«ÐÔ¡£¿ÉÒÔ»ùÓÚÊý¾Ý¿âµÄֵʹÓû§¾ßÓвÙ×÷Êý¾Ý¿âµÄijÖÖȨÀû¡£
¡¡¡¡# ¿ÉÒÔ»ùÓÚʱ¼äÏÞÖÆÓû§µÄ²Ù×÷£¬ÀýÈç²»ÔÊÐíϰàºóºÍ½Ú¼ÙÈÕÐÞ¸ÄÊý¾Ý¿âÊý¾Ý¡£ ......
Can you connect to an Oracle database with a 64-bit Oracle client?
Technote (FAQ)
Question
You are unable to connect to an Oracle database with a 64-bit Oracle client. Does Lotus Enterprise Integrator (LEI), Lotus Domino Enterprise Connection Services (DECS), or LSX ......
oracle Êý¾Ý¿âµÄά»¤
¿ì¹ýÄêÁË£¬¸÷¼Ò¹«Ë¾¶¼Òª×¼±¸·Å¼ÙÁË£¬¸ø×Ô¼ºµÄÊý¾Ý¿â×ö¸öÌå¼ì°É£¬Ð´¸ö±¨¸æÖ®ÀàµÄ£¬ºÇºÇ¡£
¿´Á˸ö±ðÈËдµÄ ÏÈÄÃÀ´´æ×Å ÓпÕ×Ô¼º±à¸ö¡£
ÔØ×ÔoracleÖÐÎļ¼ÊõÂÛ̳¡£´ÓÕûÌåÉϽéÉÜÁËÒ»¸ödbaµÄÖ°ÔðºÍÈÎÎñµÈµÈ¡£¡¡¡¡
ORACLEÊý¾Ý¿â¹ÜÀíÔ±Ó¦°´ÈçÏ·½Ê½¶ÔORACLEÊý¾Ý¿âϵͳ×ö¶¨ÆÚ¼à¿Ø£ ......
Cross Applyʹ±í¿ÉÒԺͱíÖµº¯Êý½á¹û½øÐÐjoin, ÕâÑù±íÖµº¯ÊýµÄ²ÎÊý¾Í¿ÉÒÔʹÓÃÒ»¸ö½á¹û¼¯£¬¶ø²»ÊÇÒ»¸ö±êÁ¿Öµ£¬ÏÂÃæÊÇbook onlineµÄÔÎÄ£¬ÓÐÀý×Ó£¬ÓнâÊÍ¡£
The APPLY operator allows you to invoke a table-valued function for each row returned by an outer table expression of a query. The table-valued function act ......