Jump to content

Sql Exfarts Ravali


nenu_devudni

Recommended Posts

vuncle .. 1 - tasty , 2 - average , 3 - bokaklaundi .

 

prioritize seyal .. 1 main priority ... lekapothe 2 .. then 2 lekapothe 3 . .. bye1

pmed chusko.. 

Link to comment
Share on other sites

  • Replies 61
  • Created
  • Last Reply

Top Posters In This Topic

  • nenu_devudni

    22

  • mettastar

    8

  • 4Vikram

    7

  • andhravodu

    7

Top Posters In This Topic

select siken,
       mutton,
       keema,
       MIN(goat_curry)
  from (select siken,
               mutton,
               keema,
      CASE WHEN goat = 'Average' then 1
           when goat = 'Tasty' then 2
           when goat = 'Bokkalaundi' then 3
      END goat_curry
       from biskit,cream_biskit, salt_bisket
      where blah = blah
        and bluh = bluh)
     group by siken,
                   mutton,
                   keema;

 

 

esonti query run sesse .. oke record ravali nak matram rendu ossunay .. fix etla seyal seppandi kasta ..

 

Cropped%20Brahmi%20shock.gif?1350345175

 

primary key ento cheppuu.. e scenarios lo distinct records kavali?? specific ga cheppu requirment..

Link to comment
Share on other sites

MIN vadite 2 vastunnayi ante, you're getting 2 same values dude. hack solution: inner select lo distinct padeyyi. performance slow avuddi kani, work avuddi

 

never use DISTINCT man.. it is wrong way to use distinct to remove a duplicate in your data.. instead you can use group by to do the same man... if you still think its fine, upto you man...

Link to comment
Share on other sites

etla unai thatha nu .. pelli petakul lev neku .. epudu aina ma uri ki osse seppa rad .. sandrakala endi dan akkai degara kuda podam .. bye1


Ella 10giru aa maa vorla kenche kotha vorlo vachi thipal padthunai...
Link to comment
Share on other sites

never use DISTINCT man.. it is wrong way to use distinct to remove a duplicate in your data.. instead you can use group by to do the same man... if you still think its fine, upto you man...

 

nenu distinct vadanu man, analytical functions only ikkada. ee babu req meeda clarity lenappudu, inner lo duplicate rows vastunnayemo ani distinct vadamanna. hack solution ani cheppaga appude

Link to comment
Share on other sites

nenu distinct vadanu man, analytical functions only ikkada. ee babu req meeda clarity lenappudu, inner lo duplicate rows vastunnayemo ani distinct vadamanna. hack solution ani cheppaga appude

 

telisi tappu cheyamani cheppadam tappu man...

Link to comment
Share on other sites

give the table structure and a couple of records and ask the output man... it will be much easier that way... this way it is just a guessing game...

metta vuncle chepinatu  below query worked .. i have tried a couple of ways but this one works just fine .. 

 

with GoatCurry as  (select siken,
               mutton,
               keema,
      CASE WHEN goat = 'Average' then 1
           when goat = 'Tasty' then 2
           when goat = 'Bokkalaundi' then 3
      END goat_curry
       from biskit,cream_biskit, salt_bisket
      where blah = blah
        and bluh = bluh)

select siken,

       mutton,
       keema,
       goat_curry
  from GoatCurry where goat_curry = (select min(goat_curry) from GoatCurry )

Link to comment
Share on other sites

give the table structure and a couple of records and ask the output man... it will be much easier that way... this way it is just a guessing game...

 

akkada vastundi

 

a, b, c, 1

d, e, f, 2
 

he wants a, b, c, 1. min vadite adi vastundi anukunnadu, kani min group chesi, bringing both rows.

 

column 4 lo 1,2 vachinappudu 1 ravali. 2,3 vachinapudu 2 ravali

 

simple answer ga outer query sort chesi, rownum <= 1 petti icha, adi work ayiddi

Link to comment
Share on other sites

naaku coding standards follow avadam istam man, rest I dont care... 

idisey uncle bye1 .. standards follow avali ante mundu coding sariga ravali kada amav2.gif?1368598266

Link to comment
Share on other sites

×
×
  • Create New...