Hello,
I'm stuck on how to handle the following query on two tables that have no common relationship. Here is what I am trying to accomplish.
TABLE 1
This table currently has two columns (although it may have more in the future). One column is called INTRO the other is called OUTRO. The table is filled with phrases that represent the intro an outro of a sentence. For example some fields in the INTRO column could be
1) What a great day
2) Today is a beautiful day
3) On day's like this
4) It's a beautiful day in the neighborhood
The column for OUTRO could have fields like
1) thanks for stopping by.
2) and that is all I have to say about that.
3) until next time.
4) see you tomorrow.
Now, table2 is called 'details'. This table has several columns (more then table1). The columns represent details on vehicles. For example columns like: MAKE, MODEL, YEAR, COLOR, etc.
So, I want to create a query that will randomly select an INTRO from table1 and randomly select an OUTRO from table1 and include it in the results from table two. So, the results would be something like this.
[INTRO.TABLE1] [YEAR.TABLE2] [MAKE.TABLE2] [MODEL.TABLE2] [OUTRO.TABLE1]
I am getting close....however any JOIN I attempt does not randomize the results of table1. What happens is that whatever INTRO is displayed.....the OUTRO is always the outro from the result row.
For example lets say the table looks like this:
INTRO | Outro
Today is good | thats is the end
Today is fair | thanks for the intro.
Intro test 1 | outro test 1
So, when I expect this:
[INTRO.TABLE1] [YEAR.TABLE2] [MAKE.TABLE2] [MODEL.TABLE2] [OUTRO.TABLE1]
I actually get this:
Today is good [YEAR.TABLE2] [MAKE.TABLE2] [MODEL.TABLE2] thats is the end
Today is fair [YEAR.TABLE2] [MAKE.TABLE2] [MODEL.TABLE2] thanks for the intro.
What I really want is RANDOM intro and outros
Today is fair [YEAR.TABLE2] [MAKE.TABLE2] [MODEL.TABLE2] thats is the end
Intro test 1 [YEAR.TABLE2] [MAKE.TABLE2] [MODEL.TABLE2] thanks for the intro.
Remember, TABLE1 and TABLE2 do NOT have the same number of columns. Any idea on how to accomplish what I am looking to do? I hope I explained it without being too confusing.
Thanks