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

Bewarse TalkArchives - 2007Cine Talk - Reviews, Gossips, Insider Info etc.Archive through January 17, 2007 � SQL Query help Previous Next

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

Ravanabrahma
Kurra Bewarse
Username: Ravanabrahma

Post Number: 878
Registered: 06-2004
Posted From: 24.136.161.233
Posted on Tuesday, January 16, 2007 - 6:53 pm:Edit PostDelete PostView Post/Check IP

Top of pagePrevious messageNext messageBottom of pageLink to this message

Thodakottu
Bewarse ke Bewarse!
Username: Thodakottu

Post Number: 15500
Registered: 03-2004
Posted From: 69.253.232.56
Posted on Tuesday, January 16, 2007 - 6:53 pm:Edit PostDelete PostView Post/Check IP

antha EP ayaru gaa
shshshshhhh.......Hearing is Going On, No Roaring in Between..
Top of pagePrevious messageNext messageBottom of pageLink to this message

Ravanabrahma
Kurra Bewarse
Username: Ravanabrahma

Post Number: 877
Registered: 06-2004
Posted From: 24.136.161.233
Posted on Tuesday, January 16, 2007 - 6:18 pm:Edit PostDelete PostView Post/Check IP

ne yanks, navvakehe, malla sepparu adigithe.
Top of pagePrevious messageNext messageBottom of pageLink to this message

Babu
Desanike Pedda Bewarse
Username: Babu

Post Number: 10816
Registered: 06-2004
Posted From: 65.208.22.25
Posted on Tuesday, January 16, 2007 - 6:00 pm:Edit PostDelete PostView Post/Check IP

hemu ga
Top of pagePrevious messageNext messageBottom of pageLink to this message

Gochi
Bewarse ke Bewarse!
Username: Gochi

Post Number: 35610
Registered: 07-2004
Posted From: 71.234.246.234
Posted on Tuesday, January 16, 2007 - 4:20 pm:Edit PostDelete PostView Post/Check IP

Top of pagePrevious messageNext messageBottom of pageLink to this message

Ravanabrahma
Kurra Bewarse
Username: Ravanabrahma

Post Number: 873
Registered: 06-2004
Posted From: 57.68.10.185
Posted on Tuesday, January 16, 2007 - 4:11 pm:Edit PostDelete PostView Post/Check IP

sorry mamalu, edo meeting ki poyicha. requirment complete ga maripoyindi. malla septha kothadi. kiki.

Thanks mamalu andariki. :-)
Top of pagePrevious messageNext messageBottom of pageLink to this message

J2ee
Vooriki Bewarse
Username: J2ee

Post Number: 5280
Registered: 08-2004
Posted From: 198.203.175.175
Posted on Tuesday, January 16, 2007 - 2:57 pm:Edit PostDelete PostView Post/Check IP

rendu unique mamalu. sare malla chostha aagandi 1st query

if unique the first query should be good enough.
check if u r getting multiple records error for the inner query.
Top of pagePrevious messageNext messageBottom of pageLink to this message

Gochi
Bewarse ke Bewarse!
Username: Gochi

Post Number: 35600
Registered: 07-2004
Posted From: 71.234.246.234
Posted on Tuesday, January 16, 2007 - 2:53 pm:Edit PostDelete PostView Post/Check IP

Top of pagePrevious messageNext messageBottom of pageLink to this message

420
Pilla Bewarse
Username: 420

Post Number: 365
Registered: 12-2006
Posted From: 85.144.114.14
Posted on Tuesday, January 16, 2007 - 2:52 pm:Edit PostDelete PostView Post/Check IP

voreee .. when i started typing . i saw only Hemu's post .. and when posted already thread 20 koteeindee
AA = 6 pack and 6 layers of face pack !
Top of pagePrevious messageNext messageBottom of pageLink to this message

Beer
Bewarse
Username: Beer

Post Number: 2156
Registered: 09-2006
Posted From: 208.204.155.241
Posted on Tuesday, January 16, 2007 - 2:51 pm:Edit PostDelete PostView Post/Check IP

update x x set inv_num = (select inv_num from y y
where x.inv_num is null and X.barcode = Y.barcode)
Beauty lies in the eye of the beer holder
Top of pagePrevious messageNext messageBottom of pageLink to this message

Ravanabrahma
Kurra Bewarse
Username: Ravanabrahma

Post Number: 872
Registered: 06-2004
Posted From: 57.68.10.185
Posted on Tuesday, January 16, 2007 - 2:51 pm:Edit PostDelete PostView Post/Check IP

rendu unique mamalu. sare malla chostha aagandi 1st query
Top of pagePrevious messageNext messageBottom of pageLink to this message

420
Pilla Bewarse
Username: 420

Post Number: 364
Registered: 12-2006
Posted From: 85.144.114.14
Posted on Tuesday, January 16, 2007 - 2:50 pm:Edit PostDelete PostView Post/Check IP

UPDATE x
set inv_num =
(Select Y.INV_NUM from Y where Y.barcode= x.barcode)
where x.inv_num is null ;

I hope inner select does not return multiple rows .. hoping barcode is unique
AA = 6 pack and 6 layers of face pack !
Top of pagePrevious messageNext messageBottom of pageLink to this message

Rediff
Desanike Pedda Bewarse
Username: Rediff

Post Number: 6278
Registered: 03-2004
Posted From: 151.151.21.101
Posted on Tuesday, January 16, 2007 - 2:50 pm:Edit PostDelete PostView Post/Check IP

>>if the barcode is unique in both the tables first query will work if not write a pl/sql procedure

yeah ..
Top of pagePrevious messageNext messageBottom of pageLink to this message

J2ee
Vooriki Bewarse
Username: J2ee

Post Number: 5279
Registered: 08-2004
Posted From: 198.203.175.175
Posted on Tuesday, January 16, 2007 - 2:50 pm:Edit PostDelete PostView Post/Check IP

inv num cannot be primary key as it has nulls so i think barcode must be unique and primary key
Top of pagePrevious messageNext messageBottom of pageLink to this message

Rediff
Desanike Pedda Bewarse
Username: Rediff

Post Number: 6277
Registered: 03-2004
Posted From: 151.151.21.101
Posted on Tuesday, January 16, 2007 - 2:49 pm:Edit PostDelete PostView Post/Check IP

>>inv_num + barcode

Idi unique aa rendu tables lo .. nullability enti ee columns .. aa details ivvu


quote:

create table X ( inv_num number(10), barcode number(10));
create table Y ( inv_num number(10), barcode number(10));
commit;
insert into X values (NULL, 10);
insert into X values (NULL, 11);
insert into X values (100, 12);
insert into X values (200, 13);
commit;
insert into y values (21, 10);
insert into y values (22, 11);
insert into y values (100, 12);
insert into y values (200, 13);
commit;

UPDATE x
SET x.inv_num = (SELECT y.inv_num
FROM y
WHERE x.barcode = y.barcode)
WHERE x.inv_num IS NULL

select * from x;




idi test chesaa nenu
Top of pagePrevious messageNext messageBottom of pageLink to this message

J2ee
Vooriki Bewarse
Username: J2ee

Post Number: 5278
Registered: 08-2004
Posted From: 198.203.175.175
Posted on Tuesday, January 16, 2007 - 2:48 pm:Edit PostDelete PostView Post/Check IP

if the barcode is unique in both the tables first query will work if not write a pl/sql procedure
Top of pagePrevious messageNext messageBottom of pageLink to this message

Rediff
Desanike Pedda Bewarse
Username: Rediff

Post Number: 6276
Registered: 03-2004
Posted From: 151.151.21.101
Posted on Tuesday, January 16, 2007 - 2:48 pm:Edit PostDelete PostView Post/Check IP

inv_num + barcode combination unique ayite in both tables .. first query work avuthundi .. ippude test chesaa
Top of pagePrevious messageNext messageBottom of pageLink to this message

Ravanabrahma
Kurra Bewarse
Username: Ravanabrahma

Post Number: 871
Registered: 06-2004
Posted From: 57.68.10.185
Posted on Tuesday, January 16, 2007 - 2:45 pm:Edit PostDelete PostView Post/Check IP

Top of pagePrevious messageNext messageBottom of pageLink to this message

Chonga
Vooriki Bewarse
Username: Chonga

Post Number: 2805
Registered: 12-2004
Posted From: 71.85.144.192
Posted on Tuesday, January 16, 2007 - 2:45 pm:Edit PostDelete PostView Post/Check IP

>>oops .. rendoo banda boothulu


Top of pagePrevious messageNext messageBottom of pageLink to this message

Ravanabrahma
Kurra Bewarse
Username: Ravanabrahma

Post Number: 870
Registered: 06-2004
Posted From: 57.68.10.185
Posted on Tuesday, January 16, 2007 - 2:45 pm:Edit PostDelete PostView Post/Check IP

1st di error vasthundi mama. 2nd di try chestha aagu mama.

is null anakunda = ' ' anali mama appudu aa select multiple rows isthundi. so left side oke value assign chesthundi. so error vasthundi mama. 2nd di try chestha.
Top of pagePrevious messageNext messageBottom of pageLink to this message

Rediff
Desanike Pedda Bewarse
Username: Rediff

Post Number: 6275
Registered: 03-2004
Posted From: 151.151.73.163
Posted on Tuesday, January 16, 2007 - 2:43 pm:Edit PostDelete PostView Post/Check IP

oops .. rendoo banda boothulu
Top of pagePrevious messageNext messageBottom of pageLink to this message

Rediff
Desanike Pedda Bewarse
Username: Rediff

Post Number: 6274
Registered: 03-2004
Posted From: 151.151.73.163
Posted on Tuesday, January 16, 2007 - 2:42 pm:Edit PostDelete PostView Post/Check IP

idi try chey ..



UPDATE x
SET x.inv_num = (SELECT y.inv_num
FROM y
WHERE x.barcode = y.barcode)
WHERE x.inv_num IS NULL


----OR idi --------

UPDATE x
SET x.inv_num = (SELECT y.inv_num
FROM y
WHERE x.barcode = y.barcode)
WHERE x.inv_num IS NULL AND x.barcode IN (SELECT x1.barcode
FROM x x1, y y1
WHERE x1.inv_num IS NULL AND x1.barcode = y1.barcode)
Top of pagePrevious messageNext messageBottom of pageLink to this message

Ravanabrahma
Kurra Bewarse
Username: Ravanabrahma

Post Number: 869
Registered: 06-2004
Posted From: 57.68.10.185
Posted on Tuesday, January 16, 2007 - 2:23 pm:Edit PostDelete PostView Post/Check IP

mamalu, ippudu idi paristhithi



naa daggara 2 tables unnayi.



X, Y tables.



renditlo common inv_num and barcode. aithe nenu X table lo unna inv_num ni update cheyyli with Y table inv_num if X table inv_num NULL ayithe and X.barcode = Y.barcode ayithe



query ela rayali??