Jump to content

Sql Help.. Urgent.. Please Help...


Recommended Posts

Posted

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@

  • Replies 44
  • Created
  • Last Reply

Top Posters In This Topic

  • Gutka_Mukesh

    11

  • vikuba

    10

  • ChampakDas

    10

  • bokuboy

    4

Popular Days

Top Posters In This Topic

Posted

nakenti ahhaa nakenti 

 

e business eppati nunchi started GK PK-1.gif

Posted

Replace abc with main table name, abctemp with temp table name, 'a' with column name pandaga chesko PK-1.gif

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
Posted
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
 
Posted

nuvu chembulo cheyi petinapatninchi PK-1.gif

e business eppati nunchi started GK PK-1.gif

 

Posted

edni vayya edhi eduvaraku countryid ledhu kada however my query works PK-1.gif

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@

 

Posted

nuvu chembulo cheyi petinapatninchi PK-1.gif

 

na chembu lo hand pettadhmani chala atram ga unnave PK-1.gif

Posted

madi tissue nee lekka chembu kadu...PK-1.gif

na chembu lo hand pettadhmani chala atram ga unnave PK-1.gif

 

Posted

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

Posted

 

Replace abc with main table name, abctemp with temp table name, 'a' with column name pandaga chesko PK-1.gif

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?

Posted

by using CASE...you can create your own column...in the resultant

Posted

madi tissue nee lekka chembu kadu...PK-1.gif

 

andharu atlane antaru..... kani situation ochhaka paper parrrrrr mantadhi chembu kavali anipistadhi PK-1.gif

Posted

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

 

×
×
  • Create New...