Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Doubts on mysql syntax
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows XP
Database:
MySQL
Divers
Thread ID:
00993594
Message ID:
00993721
Vues:
16
>Do you have a primary key (pk) in your table?
>
>Here is maybe what I would do:
>1. Select all records from table (select myPK from myTable)
>2. Draw a pk at random, myRandomPK
>3. Select entire record where pk condition is met (select * from myTable where myPK = myRandomPK)
>
This field (can be auto incremented) will simulate the recno().. right ?

Also, turning it into a key will increase a lot the time for querys.. Nice one.. Deal, contract signed.. Thanks Einar !!

>
>>>I am unsure what you are trying to accomplish. Could you please explain a little more?
>>>
>>1. draw a randon number among 1 and the number of records
>>2. go to the found record number
>>3. grab it data and process
>>
>>>>
>>>>Thanks for your repli.. I have a routine to calculate a number (makes a draw) and to skip to that specific number.. So, on this case the best (or the only) option will be:
>>>>
>>>>
>>>>nwret=SQLexec(privCone, "SELECT * FROM `mytable` limit "+allt(str(nmydraw))+",1)"
>>>>
>>>>
>>>>Is that right ? Or that is anything better ?
>>>>>>
>>>>>>
>>>>>>nReco = 10
>>>>>>goto nReco
>>>>>>
>>>>>>
>>>>>>Is there something similar on mysql for the above issue ?
>>>>>>
>>>>>>What about reccount() !! Only using "select count(*).." or there is some other way to have it ?
>>>>>>
>>>>>>TIA
>>>>>>
>>>>>>Claudio
"Now to him who is able to do immeasurably more than all we ask or imagine, according to his power that is at work within us, Ephesians 3:20
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform