Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
bobinorlando
Starting Member
1 Post |
Posted - 2013-09-06 : 18:55:07
|
How would I write a query to produce all combinations for a situation such as the following?Suppose I wanted to write a sentence, "This is [adjective] [noun]." where [adjective] comes from the Adjective table and [noun] come from the Noun table.Adjective table looks like e.g.ID Adj1 good2 so so3 badNoun table looks like e.g.ID Noun1 apple2 orange3 bananaAnd the result set would look likeThis is good apple.This is so so apple.This is bad apple.This is good orange.This is so so orange.This is bad orange.This is good banana.This is so so banana.This is bad banana.I would take a stab at this myself and post even something that doesn't work, but I honestly have no idea how to approach it.Any pointers in the right direction would be appreciated.Thanks in advance. |
|
LoztInSpace
Aged Yak Warrior
940 Posts |
Posted - 2013-09-06 : 19:49:44
|
select 'This is '+ Adjective.Adj+' '+Noun.Noun fromAdjective,Noun should do it. |
|
|
|
|
|