SQL Query Help mamalu   Independent houses near kukatpally | Apartments in Pragathi Nagar | AndhraVaani.com | Log Out | Topics | Search
Register | Edit Profile

Bewarse TalkArchives - 2006Cricket - Our National PassionArchive through May 01, 2006SQL Query Help mamalu Previous Next

Author Message
Top of pagePrevious messageNext messageBottom of pageLink to this message

Hemanth
Bewarse ke Bewarse!
Username: Hemanth

Post Number: 15188
Registered: 03-2004
Posted From: 65.196.167.82
Posted on Thursday, April 27, 2006 - 9:22 am:Edit PostDelete PostView Post/Check IP

expense_number not in anesi raasesa. pani sesindi. kiki.
Top of pagePrevious messageNext messageBottom of pageLink to this message

Hemanth
Bewarse ke Bewarse!
Username: Hemanth

Post Number: 15187
Registered: 03-2004
Posted From: 65.196.167.82
Posted on Thursday, April 27, 2006 - 9:21 am:Edit PostDelete PostView Post/Check IP

yeh, ayipoyindi, nenu inka expense numbers gatra vaadala, creation date koda, batch no 1 fine ade ee roju pampindi, except that antha bagane undi. ninna maa collegue gadiki vanuku vachindi. matter senior vice president daggaraki vellindi. emaindo motham cheppamani phone chesadu. kiki. nenu 6 bank ki cut off ayithe last file 5:56 ki pampa. kiki. final ga matter antha set ayyindi.

thanks gochi and bomma lu. :-)
Top of pagePrevious messageNext messageBottom of pageLink to this message

Bommarillu
Pilla Bewarse
Username: Bommarillu

Post Number: 277
Registered: 07-2005
Posted From: 12.41.255.10
Posted on Thursday, April 27, 2006 - 9:14 am:Edit PostDelete PostView Post/Check IP

yep it's the same. What i wrote is a refined form of a query.
Top of pagePrevious messageNext messageBottom of pageLink to this message

Gochi
Bewarse ke Bewarse!
Username: Gochi

Post Number: 19538
Registered: 07-2004
Posted From: 162.136.192.1
Posted on Thursday, April 27, 2006 - 8:56 am:Edit PostDelete PostView Post/Check IP

bomma gaaru baaga raasaru query..kaani manam ittanti joinslo saana weak..

D left join H on d.batchid = h.batchid And d.expenseNo = h.expenseNo

ante enti...is it same as

d.batchid = h.batchid(+)
And d.expenseNo = h.expenseNo(+)
Top of pagePrevious messageNext messageBottom of pageLink to this message

Bommarillu
Pilla Bewarse
Username: Bommarillu

Post Number: 276
Registered: 07-2005
Posted From: 12.41.255.10
Posted on Thursday, April 27, 2006 - 8:51 am:Edit PostDelete PostView Post/Check IP

DE: okelaga unnayi kani my query is faster performance wise than gochi's.
Top of pagePrevious messageNext messageBottom of pageLink to this message

Donga_evaru
Bewarse ke Bewarse!
Username: Donga_evaru

Post Number: 15870
Registered: 08-2004
Posted From: 134.130.20.127
Posted on Thursday, April 27, 2006 - 8:32 am:Edit PostDelete PostView Post/Check IP

idharu cheppinavi okaelaga vunnayi kadha..
Top of pagePrevious messageNext messageBottom of pageLink to this message

Diamondweapon1
Pilla Bewarse
Username: Diamondweapon1

Post Number: 8
Registered: 04-2006
Posted From: 12.35.237.21
Posted on Thursday, April 27, 2006 - 8:32 am:Edit PostDelete PostView Post/Check IP

mee iddari debbaki chinna queries marchipothadu
Top of pagePrevious messageNext messageBottom of pageLink to this message

Bommarillu
Pilla Bewarse
Username: Bommarillu

Post Number: 275
Registered: 07-2005
Posted From: 12.41.255.10
Posted on Thursday, April 27, 2006 - 8:18 am:Edit PostDelete PostView Post/Check IP

I think what gochi said migh work but this will definetly give you the extra rows

Select d.* from Details d
left join Header h
On d.batchid = h.batchid
And d.expenseNo = h.expenseNo
Where h.batchid is null and d.batchid = 1

Replace the select with delete.

Its a simple left join.
Top of pagePrevious messageNext messageBottom of pageLink to this message

Gochi
Bewarse ke Bewarse!
Username: Gochi

Post Number: 19522
Registered: 07-2004
Posted From: 162.136.192.1
Posted on Thursday, April 27, 2006 - 8:14 am:Edit PostDelete PostView Post/Check IP

itta raasthey aa extra rows anni vasthaayemo maama..try cheyyi..



select * from DETAILS
where batch_id = 1
and not exists in (select * from HEADERS H, DETAILS D
where H.batch_id = D.Batch_id
and H.expense_number = D.expense_number
and H.creation_date = D.creation_date)
Top of pagePrevious messageNext messageBottom of pageLink to this message

Gochi
Bewarse ke Bewarse!
Username: Gochi

Post Number: 19521
Registered: 07-2004
Posted From: 162.136.192.1
Posted on Thursday, April 27, 2006 - 8:08 am:Edit PostDelete PostView Post/Check IP

poddunne SQL doubt aduguthaava...
Top of pagePrevious messageNext messageBottom of pageLink to this message

Bommarillu
Pilla Bewarse
Username: Bommarillu

Post Number: 274
Registered: 07-2005
Posted From: 12.41.255.10
Posted on Thursday, April 27, 2006 - 7:49 am:Edit PostDelete PostView Post/Check IP

do you still want the solution for this or did you already figure it out? Because if you do need it, I can write the solution query here.
Top of pagePrevious messageNext messageBottom of pageLink to this message

Hemanth
Bewarse ke Bewarse!
Username: Hemanth

Post Number: 15182
Registered: 03-2004
Posted From: 65.196.167.82
Posted on Wednesday, April 26, 2006 - 10:23 am:Edit PostDelete PostView Post/Check IP

idantha rasepatiki naake idea vachela undi. kikiki. aagandi try setha.
Top of pagePrevious messageNext messageBottom of pageLink to this message

Hemanth
Bewarse ke Bewarse!
Username: Hemanth

Post Number: 15181
Registered: 03-2004
Posted From: 65.196.167.82
Posted on Wednesday, April 26, 2006 - 10:22 am:Edit PostDelete PostView Post/Check IP

mamalu, naa daggara 2 tables unnayi.headers and details.

ippuudu emaindante details table lo konni records extra vachayi. columns vachi

1. Batch id 2. expense number 3. creation_date rendu tables lo

details table lo rows delete cheyyali evi ante ninna load chesinavi, kaani konni rows unchali, avi correct vee. ippudu 1st table ki relation entante

sample data.

headers

1. batch_id 2. expense_number 3. creation_data

230 1234 2/3/2005
1 12345 04/25/2006

details.


1. batch_id 2. expense_number 3. creation_data

230 1234 2/3/2005
1 12345 04/25/2006
1 1234 2/3/2005

ippudu nenu cheyyalsindi entante batch id 1 unna anni rows delete cheyyali from details table except the rows that are there in the headers table with the batch id 1.