Querying random data from 3 fields or 3 tables?

  • Thread starter Thread starter NitroLiq
  • Start date Start date
N

NitroLiq

Guest
Hope someone can help me with my query dilemma. I'm trying to build an idea generator for 3D modelers. The idea is that users will be able to click a button and it will query the database and return one random result from each column I specify. For example, I built a db called, "ideas.mdb", which has 4 fields (ID, CharacterType, Profession, Environment). Now when a user clicks the button, the query should randomly pick a character, a profession, and an environment. I tried following someone's advice on here by setting the primary key to autonumber and making the future values "random" but I just get an error when trying to preview in asp.net/c#. Normal incrementing works fine, though. I also decided to split everything out so now instead of having the one table, I now have 3 tables with 2 columns (ex. CharacterID, CharacterType) and so on for the other two categories.

So, my questions are:

Can I make one query that pulls data from 3 cols in one table (pulling one result randomly from each column)?

If not, how do I query random results from each table based on (CharacterType, ProfessionType, and EnvironmentType) and not have it repeat very often?
 

Users who are viewing this thread

Back
Top Bottom