|
syedtameem11
Starting Member
6 Posts |
Posted - 2009-04-25 : 06:39:11
|
| Hi,The stored procedure is as follows,SELECT FirstName, LastName,Religon, Martialstatus,BirthPlace, Nationality, Caste, SubCaste, MotherTongue,Height, Complexion, Familytype, Familyvalues,Profession, Income, Diet, Drink, Smoke,Individuald, ISNULL(sum(relevance),0) as relevanceFROM (SELECT Individualdata.FirstName as FirstName, Individualdata.LastName as LastName,Individualdata.Religon as Religon, Individualdata.Martialstatus as Martialstatus,Individualdata.BirthPlace as BirthPlace, Individualdata.Nationality as Nationality, Individualdata.Caste as Caste, Individualdata.SubCaste as SubCaste,Individualdata.MotherTongue as MotherTongue,Individualdata.Height as Height, Individualdata.Complexion as Complexion,Individualdata.Familytype as Familytype, Individualdata.Familyvalues as Familyvalues,IndivInterest.Profession as Profession, IndivInterest.Income as Income, IndivInterest.Diet as Diet, IndivInterest.Drink as Drink, IndivInterest.Smoke as Smoke,Individualdata.Individuald as Individuald, 6 AS relevance FROM Individualdata,IndivInterest WHERE Individualdata.Individuald = IndivInterest.IndividualdAND FREETEXT(Individualdata.BIRTHPLACE, 'Bengaluru')UNIONSELECT Individualdata.FirstName as FirstName, Individualdata.LastName as LastName,Individualdata.Religon as Religon, Individualdata.Martialstatus as Martialstatus,Individualdata.BirthPlace as BirthPlace, Individualdata.Nationality as Nationality, Individualdata.Caste as Caste, Individualdata.SubCaste as SubCaste,Individualdata.MotherTongue as MotherTongue,Individualdata.Height as Height, Individualdata.Complexion as Complexion,Individualdata.Familytype as Familytype, Individualdata.Familyvalues as Familyvalues,IndivInterest.Profession as Profession, IndivInterest.Income as Income, IndivInterest.Diet as Diet, IndivInterest.Drink as Drink, IndivInterest.Smoke as Smoke,Individualdata.Individuald as Individuald, 7 AS relevance FROM Individualdata,IndivInterest WHERE Individualdata.Individuald = IndivInterest.IndividualdAND FREETEXT(Individualdata.NATIONALITY,'India')UNIONSELECT Individualdata.FirstName as FirstName, Individualdata.LastName as LastName,Individualdata.Religon as Religon, Individualdata.Martialstatus as Martialstatus,Individualdata.BirthPlace as BirthPlace, Individualdata.Nationality as Nationality, Individualdata.Caste as Caste, Individualdata.SubCaste as SubCaste,Individualdata.MotherTongue as MotherTongue,Individualdata.Height as Height, Individualdata.Complexion as Complexion,Individualdata.Familytype as Familytype, Individualdata.Familyvalues as Familyvalues,IndivInterest.Profession as Profession, IndivInterest.Income as Income, IndivInterest.Diet as Diet, IndivInterest.Drink as Drink, IndivInterest.Smoke as Smoke,Individualdata.Individuald as Individuald, 6 AS relevance FROM Individualdata,IndivInterest WHERE Individualdata.Individuald = IndivInterest.IndividualdAND FREETEXT(Individualdata.RELIGON,'Hindu')UNIONSELECT Individualdata.FirstName as FirstName, Individualdata.LastName as LastName,Individualdata.Religon as Religon, Individualdata.Martialstatus as Martialstatus,Individualdata.BirthPlace as BirthPlace, Individualdata.Nationality as Nationality, Individualdata.Caste as Caste, Individualdata.SubCaste as SubCaste,Individualdata.MotherTongue as MotherTongue,Individualdata.Height as Height, Individualdata.Complexion as Complexion,Individualdata.Familytype as Familytype, Individualdata.Familyvalues as Familyvalues,IndivInterest.Profession as Profession, IndivInterest.Income as Income, IndivInterest.Diet as Diet, IndivInterest.Drink as Drink, IndivInterest.Smoke as Smoke,Individualdata.Individuald as Individuald, 7 AS relevance FROM Individualdata,IndivInterest WHERE Individualdata.Individuald = IndivInterest.IndividualdAND FREETEXT(Individualdata.CASTE,'Hindu:Niyogi')UNIONSELECT Individualdata.FirstName as FirstName, Individualdata.LastName as LastName,Individualdata.Religon as Religon, Individualdata.Martialstatus as Martialstatus,Individualdata.BirthPlace as BirthPlace, Individualdata.Nationality as Nationality, Individualdata.Caste as Caste, Individualdata.SubCaste as SubCaste,Individualdata.MotherTongue as MotherTongue,Individualdata.Height as Height, Individualdata.Complexion as Complexion,Individualdata.Familytype as Familytype, Individualdata.Familyvalues as Familyvalues,IndivInterest.Profession as Profession, IndivInterest.Income as Income, IndivInterest.Diet as Diet, IndivInterest.Drink as Drink, IndivInterest.Smoke as Smoke,Individualdata.Individuald as Individuald, 6 AS relevance FROM Individualdata,IndivInterest WHERE Individualdata.Individuald = IndivInterest.IndividualdAND FREETEXT(Individualdata.SUBCASTE,'Hindu:Niyogi')UNIONSELECT Individualdata.FirstName as FirstName, Individualdata.LastName as LastName,Individualdata.Religon as Religon, Individualdata.Martialstatus as Martialstatus,Individualdata.BirthPlace as BirthPlace, Individualdata.Nationality as Nationality, Individualdata.Caste as Caste, Individualdata.SubCaste as SubCaste,Individualdata.MotherTongue as MotherTongue,Individualdata.Height as Height, Individualdata.Complexion as Complexion,Individualdata.Familytype as Familytype, Individualdata.Familyvalues as Familyvalues,IndivInterest.Profession as Profession, IndivInterest.Income as Income, IndivInterest.Diet as Diet, IndivInterest.Drink as Drink, IndivInterest.Smoke as Smoke,Individualdata.Individuald as Individuald, 7 AS relevance FROM Individualdata,IndivInterest WHERE Individualdata.Individuald = IndivInterest.IndividualdAND FREETEXT(Individualdata.MOTHERTONGUE,'Kannada')UNIONSELECT Individualdata.FirstName as FirstName, Individualdata.LastName as LastName,Individualdata.Religon as Religon, Individualdata.Martialstatus as Martialstatus,Individualdata.BirthPlace as BirthPlace, Individualdata.Nationality as Nationality, Individualdata.Caste as Caste, Individualdata.SubCaste as SubCaste,Individualdata.MotherTongue as MotherTongue,Individualdata.Height as Height, Individualdata.Complexion as Complexion,Individualdata.Familytype as Familytype, Individualdata.Familyvalues as Familyvalues,IndivInterest.Profession as Profession, IndivInterest.Income as Income, IndivInterest.Diet as Diet, IndivInterest.Drink as Drink, IndivInterest.Smoke as Smoke,Individualdata.Individuald as Individuald, 6 AS relevance FROM Individualdata,IndivInterest WHERE Individualdata.Individuald = IndivInterest.IndividualdAND FREETEXT(Individualdata.HEIGHT,'5')UNIONSELECT Individualdata.FirstName as FirstName, Individualdata.LastName as LastName,Individualdata.Religon as Religon, Individualdata.Martialstatus as Martialstatus,Individualdata.BirthPlace as BirthPlace, Individualdata.Nationality as Nationality, Individualdata.Caste as Caste, Individualdata.SubCaste as SubCaste,Individualdata.MotherTongue as MotherTongue,Individualdata.Height as Height, Individualdata.Complexion as Complexion,Individualdata.Familytype as Familytype, Individualdata.Familyvalues as Familyvalues,IndivInterest.Profession as Profession, IndivInterest.Income as Income, IndivInterest.Diet as Diet, IndivInterest.Drink as Drink, IndivInterest.Smoke as Smoke,Individualdata.Individuald as Individuald, 7 AS relevance FROM Individualdata,IndivInterest WHERE Individualdata.Individuald = IndivInterest.IndividualdAND FREETEXT(Individualdata.COMPLEXION,'Very Fair')UNIONSELECT Individualdata.FirstName as FirstName, Individualdata.LastName as LastName,Individualdata.Religon as Religon, Individualdata.Martialstatus as Martialstatus,Individualdata.BirthPlace as BirthPlace, Individualdata.Nationality as Nationality, Individualdata.Caste as Caste, Individualdata.SubCaste as SubCaste,Individualdata.MotherTongue as MotherTongue,Individualdata.Height as Height, Individualdata.Complexion as Complexion,Individualdata.Familytype as Familytype, Individualdata.Familyvalues as Familyvalues,IndivInterest.Profession as Profession, IndivInterest.Income as Income, IndivInterest.Diet as Diet, IndivInterest.Drink as Drink, IndivInterest.Smoke as Smoke,Individualdata.Individuald as Individuald, 6 AS relevance FROM Individualdata,IndivInterest WHERE Individualdata.Individuald = IndivInterest.IndividualdAND FREETEXT(Individualdata.FAMILYTYPE,'Joint family')UNIONSELECT Individualdata.FirstName as FirstName, Individualdata.LastName as LastName,Individualdata.Religon as Religon, Individualdata.Martialstatus as Martialstatus,Individualdata.BirthPlace as BirthPlace, Individualdata.Nationality as Nationality, Individualdata.Caste as Caste, Individualdata.SubCaste as SubCaste,Individualdata.MotherTongue as MotherTongue,Individualdata.Height as Height, Individualdata.Complexion as Complexion,Individualdata.Familytype as Familytype, Individualdata.Familyvalues as Familyvalues,IndivInterest.Profession as Profession, IndivInterest.Income as Income, IndivInterest.Diet as Diet, IndivInterest.Drink as Drink, IndivInterest.Smoke as Smoke,Individualdata.Individuald as Individuald, 7 AS relevance FROM Individualdata,IndivInterest WHERE Individualdata.Individuald = IndivInterest.IndividualdAND FREETEXT(Individualdata.FAMILYVALUES,'Traditional')UNIONSELECT Individualdata.FirstName as FirstName, Individualdata.LastName as LastName,Individualdata.Religon as Religon, Individualdata.Martialstatus as Martialstatus,Individualdata.BirthPlace as BirthPlace, Individualdata.Nationality as Nationality, Individualdata.Caste as Caste, Individualdata.SubCaste as SubCaste,Individualdata.MotherTongue as MotherTongue,Individualdata.Height as Height, Individualdata.Complexion as Complexion,Individualdata.Familytype as Familytype, Individualdata.Familyvalues as Familyvalues,IndivInterest.Profession as Profession, IndivInterest.Income as Income, IndivInterest.Diet as Diet, IndivInterest.Drink as Drink, IndivInterest.Smoke as Smoke,Individualdata.Individuald as Individuald, 6 AS relevance FROM Individualdata,IndivInterest WHERE Individualdata.Individuald = IndivInterest.IndividualdAND FREETEXT(IndivInterest.PROFESSION,'Software')UNIONSELECT Individualdata.FirstName as FirstName, Individualdata.LastName as LastName,Individualdata.Religon as Religon, Individualdata.Martialstatus as Martialstatus,Individualdata.BirthPlace as BirthPlace, Individualdata.Nationality as Nationality, Individualdata.Caste as Caste, Individualdata.SubCaste as SubCaste,Individualdata.MotherTongue as MotherTongue,Individualdata.Height as Height, Individualdata.Complexion as Complexion,Individualdata.Familytype as Familytype, Individualdata.Familyvalues as Familyvalues,IndivInterest.Profession as Profession, IndivInterest.Income as Income, IndivInterest.Diet as Diet, IndivInterest.Drink as Drink, IndivInterest.Smoke as Smoke,Individualdata.Individuald as Individuald, 7 AS relevance FROM Individualdata,IndivInterest WHERE Individualdata.Individuald = IndivInterest.IndividualdAND FREETEXT(IndivInterest.INCOME,'Below Rs. 50,000')UNIONSELECT Individualdata.FirstName as FirstName, Individualdata.LastName as LastName,Individualdata.Religon as Religon, Individualdata.Martialstatus as Martialstatus,Individualdata.BirthPlace as BirthPlace, Individualdata.Nationality as Nationality, Individualdata.Caste as Caste, Individualdata.SubCaste as SubCaste,Individualdata.MotherTongue as MotherTongue,Individualdata.Height as Height, Individualdata.Complexion as Complexion,Individualdata.Familytype as Familytype, Individualdata.Familyvalues as Familyvalues,IndivInterest.Profession as Profession, IndivInterest.Income as Income, IndivInterest.Diet as Diet, IndivInterest.Drink as Drink, IndivInterest.Smoke as Smoke,Individualdata.Individuald as Individuald, 6 AS relevance FROM Individualdata,IndivInterest WHERE Individualdata.Individuald = IndivInterest.IndividualdAND FREETEXT(IndivInterest.DIET,'Vegetarian')UNIONSELECT Individualdata.FirstName as FirstName, Individualdata.LastName as LastName,Individualdata.Religon as Religon, Individualdata.Martialstatus as Martialstatus,Individualdata.BirthPlace as BirthPlace, Individualdata.Nationality as Nationality, Individualdata.Caste as Caste, Individualdata.SubCaste as SubCaste,Individualdata.MotherTongue as MotherTongue,Individualdata.Height as Height, Individualdata.Complexion as Complexion,Individualdata.Familytype as Familytype, Individualdata.Familyvalues as Familyvalues,IndivInterest.Profession as Profession, IndivInterest.Income as Income, IndivInterest.Diet as Diet, IndivInterest.Drink as Drink, IndivInterest.Smoke as Smoke,Individualdata.Individuald as Individuald, 7 AS relevance FROM Individualdata,IndivInterest WHERE Individualdata.Individuald = IndivInterest.IndividualdAND FREETEXT(IndivInterest.DRINK,'Yes')UNIONSELECT Individualdata.FirstName as FirstName, Individualdata.LastName as LastName,Individualdata.Religon as Religon, Individualdata.Martialstatus as Martialstatus,Individualdata.BirthPlace as BirthPlace, Individualdata.Nationality as Nationality, Individualdata.Caste as Caste, Individualdata.SubCaste as SubCaste,Individualdata.MotherTongue as MotherTongue,Individualdata.Height as Height, Individualdata.Complexion as Complexion,Individualdata.Familytype as Familytype, Individualdata.Familyvalues as Familyvalues,IndivInterest.Profession as Profession, IndivInterest.Income as Income, IndivInterest.Diet as Diet, IndivInterest.Drink as Drink, IndivInterest.Smoke as Smoke,Individualdata.Individuald as Individuald, 6 AS relevance FROM Individualdata,IndivInterest WHERE Individualdata.Individuald = IndivInterest.IndividualdAND FREETEXT(IndivInterest.SMOKE,'Yes')) resultsGROUP BY FirstName, LastName,Religon, Martialstatus,BirthPlace, Nationality, Caste, SubCaste, MotherTongue,Height, Complexion, Familytype, Familyvalues,Profession, Income, Diet, Drink, Smoke,Individuald order by relevance descHere relevance i am assiging some values. it will sum and give the result. But the result is not accurate and If i gave all the relevance value as for ex.6 then it will return 6 only if multiple columns match. It will not sum and get the valueAny Help,ThanksSyed Tameemuddin |
 |
|