Gutka_Mukesh Posted November 14, 2013 Report Posted November 14, 2013 Changed the first post... want to make this simple.. I want to make this simple.... consider this... Fist Table data ID ProjectName 1 A 1 B 1 C second table data ProjectName Name A John Naku kavalasina result... ID ProjectName Name 1 A John 1 B John 1 C John Please help... very urgent.. CITI#H@
bokuboy Posted November 14, 2013 Report Posted November 14, 2013 nakenti ahhaa nakenti e business eppati nunchi started GK
ChampakDas Posted November 14, 2013 Report Posted November 14, 2013 Replace abc with main table name, abctemp with temp table name, 'a' with column name pandaga chesko SELECT B.a,A.* FROM abc A JOIN abctemp B ON A.a=left(B.a, charindex('-', B.a)-1) ON A.CountryId=B.CountryId
vasu1234 Posted November 14, 2013 Report Posted November 14, 2013 Try this.. Select T1.Country, T2.Country, T1.Person, T2.Country_ID From Temp T2 Join Country Table T1 On T2.CountryID = T1.CountryID Group By 1
ChampakDas Posted November 14, 2013 Report Posted November 14, 2013 nuvu chembulo cheyi petinapatninchi e business eppati nunchi started GK
ChampakDas Posted November 14, 2013 Report Posted November 14, 2013 edni vayya edhi eduvaraku countryid ledhu kada however my query works CountryTable: Country Person CountryID India A 1 USA B 2 Africa C 3 Paina unna table data ni modify chesi oka temp table lo pettanu... TempTable: Country CountryID India-AP 1 India-MP 1 India-UP 1 USA-Texas 2 USA-California 2 USA-NY 2 Africa-Zimbabwe 3 Africa-Angola 3 Naku kavalasina result... Country Person CountryID India-AP A 1 India-MP A 1 India-UP A 1 USA-Texas B 2 USA-California B 2 USA-NY B 2 Africa-Zimbabwe C 3 Africa-Angola C 3 Please help... very urgent.. CITI#H@
bokuboy Posted November 14, 2013 Report Posted November 14, 2013 nuvu chembulo cheyi petinapatninchi na chembu lo hand pettadhmani chala atram ga unnave
ChampakDas Posted November 14, 2013 Report Posted November 14, 2013 madi tissue nee lekka chembu kadu... na chembu lo hand pettadhmani chala atram ga unnave
vikuba Posted November 14, 2013 Report Posted November 14, 2013 Select country, case when INDIA AP, INDIA MP , INDIA UP then A case when USA tx, USA cal, USA NY then B Case when Africa-Anti, Afirca Zim then C end as Person , countryID from TEMP TABLE.. thts it
Gutka_Mukesh Posted November 14, 2013 Author Report Posted November 14, 2013 Replace abc with main table name, abctemp with temp table name, 'a' with column name pandaga chesko SELECT B.a,A.* FROM abc A JOIN abctemp B ON A.a=left(B.a, charindex('-', B.a)-1) ON A.CountryId=B.CountryId a column name ante endi man?
vikuba Posted November 14, 2013 Report Posted November 14, 2013 by using CASE...you can create your own column...in the resultant
bokuboy Posted November 14, 2013 Report Posted November 14, 2013 madi tissue nee lekka chembu kadu... andharu atlane antaru..... kani situation ochhaka paper parrrrrr mantadhi chembu kavali anipistadhi
ChampakDas Posted November 14, 2013 Report Posted November 14, 2013 bhayya nuvu mari values restict chestunnav...INDIA-TN ani raste query update chestava malli...query's should never be dependent on values...cool Select country, case when INDIA AP, INDIA MP , INDIA UP then A case when USA tx, USA cal, USA NY then B Case when Africa-Anti, Afirca Zim then C end as Person , countryID from TEMP TABLE.. thts it
Recommended Posts