Jump to content

meegu oka sql question.... wer r u?


Recommended Posts

Posted

[quote author=INFATUATION link=topic=195931.msg2387924#msg2387924 date=1306249677]
max(createdate) is for latest date ani.......
[/quote]
adi corectee mamaa...kani nenu cheppedi okko ID ki....motham table lo max create date em sesukuntavu?

  • Replies 59
  • Created
  • Last Reply

Top Posters In This Topic

  • goli soda

    19

  • Ranga_The_Donga

    12

  • galigannarao

    11

  • gerrard

    4

Top Posters In This Topic

Posted

[quote author=goli soda link=topic=195931.msg2387912#msg2387912 date=1306249548]
idi okka ID ok baa..ala naku chala IDs unnayi...loop ayithe kastem baa chala sepu paduthundi....
[/quote]okko idki ani adigav kabatte ala cheppa. undu ayte let mee try some other way.

Posted

[quote author=goli soda link=topic=195931.msg2387929#msg2387929 date=1306249781]
adi corectee mamaa...kani nenu cheppedi okko ID ki....motham table lo max create date em sesukuntavu?
[/quote]

sorry baa naaku nee question artham ayyindhi but nenu try cheyyadaniki naku assalu db acess gani db acess gani db tools acess gani levu naa appice loo db nedhaa assalu work ledu naku naa project loo  sSa_j@il sSa_j@il

Posted

[quote author=gerrard link=topic=195931.msg2387950#msg2387950 date=1306250092]
sorry baa naaku nee question artham ayyindhi but nenu try cheyyadaniki naku assalu db acess gani db acess gani db tools acess gani levu naa appice loo db nedhaa assalu work ledu naku naa project loo  sSa_j@il sSa_j@il
[/quote]pooni leee daniki sorry lu endhuku....

Posted

max of record for that id teesukuni, others delete cheyochu, query elaano teleddu, oka subquery help teesukovalemmo  sCo_^Y
like the below query, not sure about the syntax
delete id from mytable where (select id from mytable having date != max(date))

Posted

okasari idhi try cheyyi mama...

[b]delete[/b] from tablename where name not in(

select t.name from tablename t

inner join(
select MAX(createdate)latestdate
from tablename
group by id) X

on t.createdate = X.latestdate )


Delete chese mundhu select chesi chusuko result correct vundho ledho..

just replace delete wirh [b]select [/b]

Posted

[quote author=The QUEEN link=topic=195931.msg2387968#msg2387968 date=1306250324]
max of record for that id teesukuni, others delete cheyochu, query elaano teleddu, oka subquery help teesukovalemmo  sCo_^Y
like the below query, not sure about the syntax
delete id from mytable where (select id from mytable having date != max(date))
[/quote]ila cheste vere id's kooda delete ayipotayi ranigaru. endukante max(date) tablelo max date tesukuntadi. anni records same date undali ani ledu kada S%Hi

Posted

[quote author=INFATUATION link=topic=195931.msg2387987#msg2387987 date=1306250552]
okasari idhi try cheyyi mama...

[b]delete[/b] from tablename where name not in(

select t.name from tablename t

inner join(
select MAX(createdate)latestdate
from tablename
group by id) X

on t.createdate = X.latestdate )


Delete chese mundhu select chesi chusuko result correct vundho ledho..

just replace delete wirh [b]select [/b]
[/quote] thankyou thankyou
i think this should work..... let me try....

Posted

[quote author=galigannarao link=topic=195931.msg2387991#msg2387991 date=1306250580]
ila cheste vere id's kooda delete ayipotayi ranigaru. endukante max(date) tablelo max date tesukuntadi. anni records same date undali ani ledu kada S%Hi
[/quote] @gr33d group by id add cheyali, kani having and groupby syntax formation naaku teleddu S%Hi

Posted

[quote author=k2s link=topic=195931.msg2388004#msg2388004 date=1306250710]
sSa_j@il
[/quote] *7*^ *7*^ *7*^ enti babu ee tadulo kooda neeku matter leda

Posted

[quote author=goli soda link=topic=195931.msg2388000#msg2388000 date=1306250651]
thankyou thankyou
i think this should work..... let me try....
[/quote]

ok let me know goli.....inka emaina modify cheyalo ledha ...... S%Hi S%Hi

Posted

[quote author=INFATUATION link=topic=195931.msg2388027#msg2388027 date=1306251148]
ok let me know goli.....inka emaina modify cheyalo ledha ...... S%Hi S%Hi
[/quote]i think we have to baaa. nenu check chesa queryni it is returnin multiple names for same id.

Posted

select * from dbo.EmpTable
where CreatedDate not in (select MAX(CreatedDate) from dbo.EmpTable group by id);


see if this works baaa &D_@@ &D_@@

Posted

[quote author=galigannarao link=topic=195931.msg2388037#msg2388037 date=1306251300]
i think we have to baaa. nenu check chesa queryni it is returnin multiple names for same id.
[/quote]

not in function is de key.......dhani valla delete avachu....

×
×
  • Create New...