Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have the following table structure.

CATGORY(1ST TABLE):

CATEGORY KEYWORDS
gravy-veg STEW,KORMA, VEGETABLE

rice/noodles-veg PULAV, BATH


TABLE 2:


RECIPE NAME PREPARATION STEPS

CHICKEN STEW 1. HEAT THE STEW FOR 5 MINS.

NOW SINCE IN PREPARATION STEPS IT'S CONTAINING STEW IT HAS TO MATCH WITH THE FIRST TABLE WHICH IS CONTAINING KEYWORDS STEW AND IT HAS TO EXTRACT THE RESULT AS

CATEGORY RECIPE NAME
GRAVY-VEG CHICKEN STEW

HOW CAN I DO THIS?

THIS S NOT ONYL FOR ONE KEYWORDS STEW. LIKE TAT I HAVE TO MATCH FOR EACH AND EVERY KEYWORDS.
Posted
Comments
Maciej Los 24-Feb-14 16:46pm    
Do not SHOUT! Improve your question. Don't forget to use formatting!

1 solution

The requirement does not yield to correct information as the example you have given...How can Gravy - veg be chicken stew..

For better results.. refine table 1 category key words and then use the query below:


SQL
select table1.receipename, table1.preparationsteps, table2.category
from table1
left join table2 on table1.receipename like '%' + table2.category + '%'
 
Share this answer
 
Comments
baliram bhande 23-Mar-14 5:53am    
Please edit the post and be clear or ask be specific understand to other person
Schatak 24-Mar-14 2:44am    
Its all messed up. what exactly you want ? please specify

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900