Jump to content

Database Side Pani Chese Vaallu Itu Randi Vayya..urgent Help Kaavali


Recommended Posts

Posted

active accounts ni maatrame pull cheyaali..
antey Date meeedha edoka condition undi untadhi..
likee table3.date < date
or table3.date is not null lantivi..
confirm cheskooo aaa vishayam

  • Replies 38
  • Created
  • Last Reply

Top Posters In This Topic

  • deals2buy

    15

  • Terminator II

    3

  • ARYA

    3

  • Desamudhuru

    3

Popular Days

Top Posters In This Topic

Posted

try this tooo



[color=#00008B][background=transparent]select[/background][/color][background=transparent]
so[/background][background=transparent].[/background][background=transparent]name [/background][color=#00008B][background=transparent]as[/background][/color][background=transparent] [/background][background=transparent][[/background][color=#00008B][background=transparent]table[/background][/color][background=transparent]],[/background][background=transparent]
sc[/background][background=transparent].[/background][background=transparent]name [/background][color=#00008B][background=transparent]as[/background][/color][background=transparent] [/background][background=transparent][[/background][color=#00008B][background=transparent]column[/background][/color][background=transparent]],[/background][background=transparent]
sc[/background][background=transparent].[/background][background=transparent]type[/background][background=transparent],[/background][background=transparent] sc[/background][background=transparent].[/background][background=transparent]length[/background][background=transparent],[/background][background=transparent] sc[/background][background=transparent].[/background][background=transparent]prec[/background][background=transparent],[/background][background=transparent] sc[/background][background=transparent].[/background][background=transparent]scale[/background][background=transparent],[/background][background=transparent] sc[/background][background=transparent].[/background][background=transparent]collation
[/background][color=#00008B][background=transparent]from[/background][/color][background=transparent]
sysobjects so
[/background][color=#00008B][background=transparent]inner[/background][/color][background=transparent] [/background][color=#00008B][background=transparent]join[/background][/color][background=transparent] syscolumns sc [/background][color=#00008B][background=transparent]ON[/background][/color][background=transparent] so[/background][background=transparent].[/background][background=transparent]id [/background][background=transparent]=[/background][background=transparent] sc[/background][background=transparent].[/background][background=transparent]id

[/background][color=#00008B][background=transparent]where[/background][/color][background=transparent] so[/background][background=transparent].[/background][background=transparent]type[/background][background=transparent]=[/background][color=#800000][background=transparent]'u'[/background][/color][background=transparent]

[/background][color=#00008B][background=transparent]order[/background][/color][background=transparent] [/background][color=#00008B][background=transparent]by[/background][/color][background=transparent] so[/background][background=transparent].[/background][background=transparent]name[/background][background=transparent],[/background][background=transparent] sc[/background][background=transparent].[/background][background=transparent]colorder[/background]

Posted

[quote name='eela' timestamp='1352310801' post='1302758500']
inner join
[/quote]

[quote name='kevkekaa' timestamp='1352310703' post='1302758491']

only active members ni pull cheyyali annav kada.. so inner join vadali anukunta.. ideal ga nee table 3 lo motham dataset vundali.. so inner join on table 3 should be ok.. but let others also conpirm
[/quote]

inner join cheste result set lo unna customer_ids table 3 lekapothe avi lechipotayi kadaa..appudu paristhiti enti?
[quote name='Desamudhuru' timestamp='1352310947' post='1302758516']
baaa its my opinion tho chepthuna correct kaka pothe i'm sorry

select * from resulttable
where customer_id =
(
select customer_id from table3 where Date >= @date
)



ela try cheyi coding lo nenu anta perfect kadu so niku emaina logic help ithadi ani vesanu
[/quote]

good try mama... oka id ni compare chesetappudu aithe '=' use cheyyochu..but multiple chesetappudu aithe 'IN' use cheyyali..llike this

select * from resulttable
where customer_id IN
(
select customer_id from table3 where Date >= @date
)

[quote name='Aamphat' timestamp='1352310958' post='1302758518']
select table3.datecol from table, table2, table3
where table1.col = table2.col
and table2.colcol = table2.colcol


col is the common column in table1 and table 2
colcol is the common column in table2 and table 3
[/quote]

I need to pull only common column which is the customer_id.. spl ga nenu table 1 and 2 join cheyyakkarledu..avi already join chesi oka result set(view) lo pettunnayi
[quote name='Aamphat' timestamp='1352311041' post='1302758525']
active accounts ni maatrame pull cheyaali..
antey Date meeedha edoka condition undi untadhi..
likee table3.date < date
or table3.date is not null lantivi..
confirm cheskooo aaa vishayam
[/quote]

ya filter lo date already undi like mydate > getdate() ani..but question antha what kind of join use cheyyali ani?
[quote name='Desamudhuru' timestamp='1352311053' post='1302758527']
try this tooo



[color=#00008B][background=transparent]select[/background][/color]
[background=transparent]so[/background][background=transparent].[/background][background=transparent]name [/background][color=#00008B][background=transparent]as[/background][/color][background=transparent] [/background][background=transparent][[/background][color=#00008B][background=transparent]table[/background][/color][background=transparent]],[/background]
[background=transparent]sc[/background][background=transparent].[/background][background=transparent]name [/background][color=#00008B][background=transparent]as[/background][/color][background=transparent] [/background][background=transparent][[/background][color=#00008B][background=transparent]column[/background][/color][background=transparent]],[/background]
[background=transparent]sc[/background][background=transparent].[/background][background=transparent]type[/background][background=transparent],[/background][background=transparent] sc[/background][background=transparent].[/background][background=transparent]length[/background][background=transparent],[/background][background=transparent] sc[/background][background=transparent].[/background][background=transparent]prec[/background][background=transparent],[/background][background=transparent] sc[/background][background=transparent].[/background][background=transparent]scale[/background][background=transparent],[/background][background=transparent] sc[/background][background=transparent].[/background][background=transparent]collation[/background]
[color=#00008B][background=transparent]from[/background][/color]
[background=transparent]sysobjects so[/background]
[color=#00008B][background=transparent]inner[/background][/color][background=transparent] [/background][color=#00008B][background=transparent]join[/background][/color][background=transparent] syscolumns sc [/background][color=#00008B][background=transparent]ON[/background][/color][background=transparent] so[/background][background=transparent].[/background][background=transparent]id [/background][background=transparent]=[/background][background=transparent] sc[/background][background=transparent].[/background][background=transparent]id[/background]

[color=#00008B][background=transparent]where[/background][/color][background=transparent] so[/background][background=transparent].[/background][background=transparent]type[/background][background=transparent]=[/background][color=#800000][background=transparent]'u'[/background][/color]

[color=#00008B][background=transparent]order[/background][/color][background=transparent] [/background][color=#00008B][background=transparent]by[/background][/color][background=transparent] so[/background][background=transparent].[/background][background=transparent]name[/background][background=transparent],[/background][background=transparent] sc[/background][background=transparent].[/background][background=transparent]colorder[/background]
[/quote]

too complex ga alochistunnav nuvvu..intha scene avasaram ledu

Posted

[quote name='deals2buy' timestamp='1352312502' post='1302758743']
inner join cheste result set lo unna customer_ids table 3 lekapothe avi lechipotayi kadaa..appudu paristhiti enti?


[/quote]

appudu incomplete data in table 3 avuthundi.. alagani outer join chesthe.. neeku join chesina use vundadu.. so table 3 lo customer id lekapothe that is not ur issue..

Posted

idi try chey boss...
select * from table3
where customer_id in
(select customer_id from table3) and Date >= @date

since you need only the customer id column, you can replace the * with customer_id

Posted

[quote name='kevkekaa' timestamp='1352312922' post='1302758794']

appudu incomplete data in table 3 avuthundi.. alagani outer join chesthe.. neeku join chesina use vundadu.. so table 3 lo customer id lekapothe that is not ur issue..
[/quote]

ya nenu ade anukunna...ala anukune inner join use chesa..but repu deploy chesaka QA lo vaadu enduku ani saava kottaka munde pros and cons teluskundaam ani adigaanu... thanks mama
[quote name='ARYA' timestamp='1352313041' post='1302758809']
idi try chey boss...
select * from table3
where customer_id in
(select customer_id from table3) and Date >= @date
[/quote]

I guess nuvvu chepdaam anukuntondi idi anukunta

select * from resultset
where customer_id in
[s](select customer_id from table3) and Date > = @date[/s]

but this should be like this

select * from resultset
where customer_id in
(select customer_id from table3 where date >=@date)

since, I've mentioned that only table3 has the date column..anyways thanks boss

Posted

e filter add cheyyi..

where

expiration date <=getdate()

Posted

[quote name='deals2buy' timestamp='1352313347' post='1302758841']
ya nenu ade anukunna...ala anukune inner join use chesa..but repu deploy chesaka QA lo vaadu enduku ani saava kottaka munde pros and cons teluskundaam ani adigaanu... thanks mama


I guess nuvvu chepdaam anukuntondi idi anukunta

select * from resultset
where customer_id in
[s](select customer_id from table3) and Date > = @date[/s]

but this should be like this

select * from resultset
where customer_id in
(select customer_id from table3 where date >=@date)

since, I've mentioned that only table3 has the date column..anyways thanks boss
[/quote]
you said table 3 has only 1 coulmn kada mari date kuda ela add chesav boss aa bracket lo? it will throw error

Posted

[quote name='Jeedeelu' timestamp='1352313502' post='1302758861']
e filter add cheyyi..

where

expiration date <=getdate()
[/quote]

active customer ani adighte inactive chupistav endi nee moham.. aa sign itu tippu :P btw idi already added and tried rey..naa quesion join gurinchi..not filter
[quote name='ARYA' timestamp='1352313505' post='1302758863']
you said table 3 has only 1 coulmn kada mari date kuda ela add chesav boss aa bracket lo? it will throw error
[/quote]

ledu boss..clear ga mention chesa chudu.. table 3 lo id, name, manufacture_date, expiration_date unnayi ani

Posted

select * from resulttable
where customer_id IN
(
select customer_id from table3 where Date >= sysdate
)

Posted

[quote name='deals2buy' timestamp='1352313693' post='1302758884']
active customer ani adighte inactive chupistav endi nee moham.. aa sign itu tippu :P btw idi already added and tried rey..naa quesion join gurinchi..not filter


ledu boss..clear ga mention chesa chudu.. table 3 lo id, name, manufacture_date, expiration_date unnayi ani
[/quote]
neeku future voddu annavga....andhuku less than vadanu..

leda.. just = pettu... erojuki evaru active o vastharu...

sare join adigav kabatti.... inner join vadu ... customer ID matching vunnavi bayatiki vasthayi..

Posted

[quote name='deals2buy' timestamp='1352313693' post='1302758884']
active customer ani adighte inactive chupistav endi nee moham.. aa sign itu tippu :P btw idi already added and tried rey..naa quesion join gurinchi..not filter


ledu boss..clear ga mention chesa chudu.. table 3 lo id, name, manufacture_date, expiration_date unnayi ani
[/quote]
ok my bad :P

Posted

[quote name='deals2buy' timestamp='1352312502' post='1302758743']
inner join cheste result set lo unna customer_ids table 3 lekapothe avi lechipotayi kadaa..appudu paristhiti enti?


[/quote]
nee requirement clear gaa ledu vayya. active customers antey kachithamga table 3 lo column undali kada.
table3 lo lekapoyina resultset lo choopinchali ante



select * from resultset where customerId not in (select customer id where date < getdate())

where date < getdate()..... ee condition expired vaatini eliminate cheyyali. ala raayi

Posted

[quote name='padmasri123' timestamp='1352313809' post='1302758897']
select * from resulttable
where customer_id IN
(
select customer_id from table3 where Date >= sysdate
)
[/quote] nenu idi kuda try chesa...my question is ilaa raayala leka join chesi raaya query annadi?
[quote name='Jeedeelu' timestamp='1352313878' post='1302758907']
neeku future voddu annavga....andhuku less than vadanu..

leda.. just = pettu... erojuki evaru active o vastharu...

sare join adigav kabatti.... inner join vadu ... customer ID matching vunnavi bayatiki vasthayi..
[/quote]

nee moham acitve ante futre lo unnavallave kaavali kadaa... deeniki filter lo > ey work avutundi..think twice :P
[quote name='ARYA' timestamp='1352313988' post='1302758916']
ok my bad :P
[/quote]thats ok :P
[quote name='Vaampire' timestamp='1352314237' post='1302758946']
nee requirement clear gaa ledu vayya. active customers antey kachithamga table 3 lo column undali kada.
table3 lo lekapoyina resultset lo choopinchali ante



select * from resultset where customerId not in (select customer id where date < getdate())

where date < getdate()..... ee condition expired vaatini eliminate cheyyali. ala raayi
[/quote]

Table 3 reference lekka vayya..child tables lo kotha ids evadaina insert cheste appudu paristhiti endi ani asking..so avi kuda pull cheyyalana leda ani

and filter lo > use cheyyali vayya..active antunte malli inactive chupistaru endi vayya? :P

Posted

[quote name='deals2buy' timestamp='1352315157' post='1302759083']
nenu idi kuda try chesa...my question is ilaa raayala leka join chesi raaya query annadi?


nee moham acitve ante futre lo unnavallave kaavali kadaa... deeniki filter lo > ey work avutundi..think twice :P
thats ok :P


Table 3 reference lekka vayya..child tables lo kotha ids evadaina insert cheste appudu paristhiti endi ani asking..so avi kuda pull cheyyalana leda ani

and filter lo > use cheyyali vayya..active antunte malli inactive chupistaru endi vayya? :P
[/quote]
ne vuddesam lo active define cheyyi... neeku thelusthe exact ga ah sign vaduko...where clause lo..

do inner join with ur result table to table 3...

×
×
  • Create New...