random query

Dúvidas, dicas e truques de SQL, Select, Update, Delete, cláusulas, operações com joins, Funções em SQLs, etc

Poston Tue, 29 May 2007 11:48 am

Good morning everyone, I need to do a query where I get the random data in SQL Server I use the NewId in order by clause.
This query I spend a period and have to bring cellular numbers of all area codes. Aleaotorios.
Anyone know how to do it in Oracle 10 g or 9i, I believe this is possible, if the sql server, for sure in oracle that is much more stout. Surely there must be a possibility.
Location: Sao Paulo

Poston Tue, 29 May 2007 1:36 pm

Yes, the ORACLE is possible this way: viewtopic.php?t=243
Location: Portland, OR USA

Thomas F. G

Você já respondeu a dúvida de alguém hoje?

Poston Tue, 29 May 2007 2:08 pm

Or you can use the SAMPLE clause (), which brings a ' percentage ' of the number of table records: SELECT * FROM sua_tabela SAMPLE (1) where ddd = 48;

This command will bring approximately 1% of the records from the table that satisfy the condition ddd = 48.
Location: Criciúma - SC

  • See also
    Last Post

Return to SQL

Who is online

Users browsing this forum: No registered users and 1 guest