bokuboy Posted November 14, 2013 Report Posted November 14, 2013 by using CASE...you can create your own column...in the resultant maya :(
ChampakDas Posted November 14, 2013 Report Posted November 14, 2013 Country a column name ante endi man?
vikuba Posted November 14, 2013 Report Posted November 14, 2013 maya :( endhi mayya nee bongu.. maa lakkaraju ganiki marketing cheyi saami. manchodu..h1 undhi job ledhu.. training paisal endhi...candidates teeskostey itla karey tho kaisaa..
vikuba 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 well he can write the query with String identification rite.. if substring(country,4 = INDI) then ...A ani pettestey aipothadi. so appdu value update aiy ey state vachina country same kabatti...it works..
Gutka_Mukesh Posted November 14, 2013 Author Report Posted November 14, 2013 Man... table chala peddadi... edana iteration undali... anni values type cheyadam kastam man... 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 by using CASE...you can create your own column...in the resultant
SUbba LIngam Posted November 14, 2013 Report Posted November 14, 2013 well he can write the query with String identification rite.. if substring(country,4 = INDI) then ...A ani pettestey aipothadi. so appdu value update aiy ey state vachina country same kabatti...it works.. so 195+ countries ki ala cheskunta potaava enti query lo
chillax Posted November 14, 2013 Report Posted November 14, 2013 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@ Select * from maintable a, temptable b Where substr(b.country,1,instr(b.country,'-')-1)=a.country
vikuba Posted November 14, 2013 Report Posted November 14, 2013 Man... table chala peddadi... edana iteration undali... anni values type cheyadam kastam man... use string identification... if INDI then assign A..laaga.. using substring. I gave the query on lower levels...in testing perspective.. thts what i know..i dont know pl/sql types..my bad
Gutka_Mukesh Posted November 14, 2013 Author Report Posted November 14, 2013 Thanks for replying man.. em anukokunda okka sari naa question chudava?? First table lo unna person ni... 3rd table data loki marchali... using country ID in the second table... Single records for persons... unna first table.. multiple records laaga maarali... Country
vikuba Posted November 14, 2013 Report Posted November 14, 2013 so 195+ countries ki ala cheskunta potaava enti query lo maayya kshaminchandi... i gave to my knowledge.
vikuba Posted November 14, 2013 Report Posted November 14, 2013 Select * from maintable a, temptable b Where substr(b.country,1,instr(b.country,'-')-1)=a.country nice man.... good one.
SUbba LIngam Posted November 14, 2013 Report Posted November 14, 2013 Select * from maintable a, temptable b Where substr(b.country,1,instr(b.country,'-')-1)=a.country this should work !
SUbba LIngam Posted November 14, 2013 Report Posted November 14, 2013 maayya kshaminchandi... i gave to my knowledge. no worries man, naku peddaga em teleedu. me too not from the IT background
Gutka_Mukesh Posted November 14, 2013 Author Report Posted November 14, 2013 Thanks for replying man... logic not working man... Use the Id in the temp table to insert new rows in the 3rd table... Select * from maintable a, temptable b Where substr(b.country,1,instr(b.country,'-')-1)=a.country
loveindia Posted November 14, 2013 Report Posted November 14, 2013 declare @table1 table ( country char(10), person char(1), countryid int ) declare @table2 table ( country char(20), countryid int ) insert into @table1 values('India', 'A', 1) insert into @table1 values('USA', 'B', 2) insert into @table1 values('Africa', 'C', 3) insert into @table2 values('India-AP', 1) insert into @table2 values('India-MP', 1) insert into @table2 values('India-UP', 1) insert into @table2 values('USA-Texas', 2) insert into @table2 values('USA-California', 2) insert into @table2 values('USA-NY', 2) insert into @table2 values('Africa-Zim', 3) insert into @table2 values('Africa-Ang', 3) select b.country, a.person, a.countryid from @table1 a inner join @table2 b on a.countryid = b.countryid
Recommended Posts