Author |
Message |
Ravanabrahma
Bewarse Legend Username: Ravanabrahma
Post Number: 15983 Registered: 06-2004 Posted From: 98.151.191.253
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, June 29, 2011 - 6:36 pm: |
|
idi requirement.. table1 columns header_id, line_id, serial_number 9223 1 1234 9223 1 2345 9223 1 3456 --------------- table 2 columns header_id line_id deliver_id 9223 1 4 9223 1 4 9223 1 4 ------------- table3 columns deliver_id serial_number 4 1234 4 2345 4 3456 ------------- table1 and table2 ni join chesthe with header_id and line_id, we get the deliver_id from table2 which is in table3. with that delievry+_id in table3, we get a list of serial_numbers in table3. the serial_numbers for that header_id and line_id from table1, all should be in table3. If any one doesn't exists in table3, then we should not return any rows..else return 1. |
Ravanabrahma
Bewarse Legend Username: Ravanabrahma
Post Number: 15982 Registered: 06-2004 Posted From: 98.151.191.253
Rating: N/A Votes: 0 (Vote!) | Posted on Wednesday, June 29, 2011 - 6:25 pm: |
|
bhayya..ippudu Table2 lo koda line_id undi..query ela change avuthundi? |
420
Bewarse Legend Username: 420
Post Number: 11759 Registered: 12-2006 Posted From: 212.159.240.81
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 9:11 am: |
|
Ravanabrahma:ante codes nakanna 5 years peddodu ga
me and GF are same underage kids on the block Knit India,do not split India !
|
Codes
Bewarse Legend Username: Codes
Post Number: 61481 Registered: 05-2006 Posted From: 212.60.115.186
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 9:09 am: |
|
Ravanabrahma: 5 years peddodu ga
I have no budget for other people's faith in humanity.
|
Ravanabrahma
Bewarse Legend Username: Ravanabrahma
Post Number: 15980 Registered: 06-2004 Posted From: 98.151.191.253
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 9:08 am: |
|
420:It should .. its a generic SQL , when it cannot find given Serial numbers in table2 .. then the Line_ID will not be part of the result
thanks bhayya..inka naa original tables tho test cheyyali..actual ga vere extra columns koda unnay..nee code ni ardam chesukoni danni map chesukovali naa tables ki..time patidhi kastha..once again thanks bhayya.. |
Ravanabrahma
Bewarse Legend Username: Ravanabrahma
Post Number: 15979 Registered: 06-2004 Posted From: 98.151.191.253
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 9:07 am: |
|
Prasanth:aa mukka 5 years back ye maaku telusu ani akkada meaning hemesh
ante codes nakanna 5 years peddodu ga..so time pattindi |
420
Bewarse Legend Username: 420
Post Number: 11758 Registered: 12-2006 Posted From: 212.159.240.81
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 9:06 am: |
|
Ravanabrahma:ippudu different line_id 's has same serial_number then will this work? means.. line_id 1 has serail numbers 3, 4 and 5 line_id 2 has serial_numbers 4, 5 and 6
It should .. its a generic SQL , when it cannot find given Serial numbers in table2 .. then the Line_ID will not be part of the result Knit India,do not split India !
|
Codes
Bewarse Legend Username: Codes
Post Number: 61480 Registered: 05-2006 Posted From: 212.60.115.186
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 9:05 am: |
|
naku avi modata nunchi attage anipistayi.. andukani.. I have no budget for other people's faith in humanity.
|
Prasanth
Bewarse Legend Username: Prasanth
Post Number: 58420 Registered: 03-2004 Posted From: 110.76.160.100
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 9:05 am: |
|
aa mukka 5 years back ye maaku telusu ani akkada meaning hemesh Father Jagan
|
Ravanabrahma
Bewarse Legend Username: Ravanabrahma
Post Number: 15978 Registered: 06-2004 Posted From: 98.151.191.253
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 9:04 am: |
|
Codes:
pessi gadini silly fellow annanu anukunnava |
Codes
Bewarse Legend Username: Codes
Post Number: 61479 Registered: 05-2006 Posted From: 212.60.115.186
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 9:03 am: |
|
Ravanabrahma:silly ga anipinchindi
I have no budget for other people's faith in humanity.
|
Ravanabrahma
Bewarse Legend Username: Ravanabrahma
Post Number: 15977 Registered: 06-2004 Posted From: 98.151.191.253
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 9:02 am: |
|
Prasanth:MOVIEART--sunil.cry ittaantapudu kashtam avuddanaa ?
adem ledu..silly ga anipinchindi |
Prasanth
Bewarse Legend Username: Prasanth
Post Number: 58419 Registered: 03-2004 Posted From: 110.76.160.100
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 9:00 am: |
|
ittaantapudu kashtam avuddanaa ?
Father Jagan
|
Ravanabrahma
Bewarse Legend Username: Ravanabrahma
Post Number: 15976 Registered: 06-2004 Posted From: 98.151.191.253
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 8:59 am: |
|
Prasanth:
nenu inka movie disco lu aapedham anukunna.. |
Ravanabrahma
Bewarse Legend Username: Ravanabrahma
Post Number: 15975 Registered: 06-2004 Posted From: 98.151.191.253
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 8:59 am: |
|
ippudu different line_id 's has same serial_number then will this work? means.. line_id 1 has serail numbers 3, 4 and 5 line_id 2 has serial_numbers 4, 5 and 6 |
Prasanth
Bewarse Legend Username: Prasanth
Post Number: 58418 Registered: 03-2004 Posted From: 110.76.160.100
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 8:58 am: |
|
Father Jagan
|
420
Bewarse Legend Username: 420
Post Number: 11757 Registered: 12-2006 Posted From: 212.159.240.81
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 8:57 am: |
|
Prasanth:in return, penkul ni mahesh ni comment setthe...uurukovaalanta mari
You timber Depot owner .. Knit India,do not split India !
|
Ravanabrahma
Bewarse Legend Username: Ravanabrahma
Post Number: 15974 Registered: 06-2004 Posted From: 98.151.191.253
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 8:56 am: |
|
420:
thanks bhayya..aagu test chestha.. |
420
Bewarse Legend Username: 420
Post Number: 11756 Registered: 12-2006 Posted From: 212.159.240.81
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 8:54 am: |
|
Ravanabrahma:cartesian product di unte ivvu bhayya
SELECT LINE_ID,SERIAL_NUMBER FROM TABLE1 where LINE_ID NOT IN ( select DISTINCT LINE_ID from TABLE1 where (LINE_ID ,SERIAL_NUMBER) NOT IN ( select T1.LINE_ID , T2.SERIAL_NUMBER from (select DISTINCT LINE_ID FROM TABLE1) T1 , (select SERIAL_NUMBER FROM TABLE2) T2 ) ) this is just for my BEmmi bedar ..
Knit India,do not split India !
|
Ravanabrahma
Bewarse Legend Username: Ravanabrahma
Post Number: 15973 Registered: 06-2004 Posted From: 98.151.191.253
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 8:46 am: |
|
420:this is based on process of ellimination trick .. there is an another trick using cartesian product ..
cartesian product di unte ivvu bhayya |
420
Bewarse Legend Username: 420
Post Number: 11755 Registered: 12-2006 Posted From: 212.159.240.81
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 8:41 am: |
|
Ravanabrahma:thankesh penkulu bhayya...aagu try chesi chostha..
waake Bedar .. leme know .. it should work for sure ..
Knit India,do not split India !
|
Prasanth
Bewarse Legend Username: Prasanth
Post Number: 58403 Registered: 03-2004 Posted From: 110.76.160.100
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 8:21 am: |
|
\thankesh penkulu bhayya...aagu try chesi chostha..\ in return, penkul ni mahesh ni comment setthe...uurukovaalanta mari.. Father Jagan
|
Ravanabrahma
Bewarse Legend Username: Ravanabrahma
Post Number: 15972 Registered: 06-2004 Posted From: 98.151.191.253
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 8:20 am: |
|
thankesh penkulu bhayya...aagu try chesi chostha.. |
Bramhanandam
Pilla Bewarse Username: Bramhanandam
Post Number: 259 Registered: 06-2011 Posted From: 62.12.14.27
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 8:02 am: |
|
Ahaa idharu G balisinollu thagulukunnaru gaa.... |
Suyodhana
Yavvanam Kaatesina Bewarse Username: Suyodhana
Post Number: 1665 Registered: 06-2007 Posted From: 117.195.141.159
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 7:27 am: |
|
idigo nannu age baar cheste naaku manduddi meesam melesi nannu |
420
Bewarse Legend Username: 420
Post Number: 11753 Registered: 12-2006 Posted From: 212.159.240.81
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 7:24 am: |
|
Suyodhana:enduku rendu sarlu cheptunna lisp aa stammering aa
its called shivering with full obedience in front of elders like you.
Knit India,do not split India !
|
Suyodhana
Yavvanam Kaatesina Bewarse Username: Suyodhana
Post Number: 1664 Registered: 06-2007 Posted From: 117.195.141.159
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 7:21 am: |
|
enduku rendu sarlu cheptunna lisp aa stammering aa |
420
Bewarse Legend Username: 420
Post Number: 11752 Registered: 12-2006 Posted From: 212.159.240.81
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 7:06 am: |
|
Suyodhana:run cheste 420 return chesindi nee id cheppataniki inta length aa
Tiger Tiger from Penkonda here . Knit India,do not split India !
|
Suyodhana
Yavvanam Kaatesina Bewarse Username: Suyodhana
Post Number: 1659 Registered: 06-2007 Posted From: 117.195.141.159
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 7:01 am: |
|
run cheste 420 return chesindi nee id cheppataniki inta length aa
|
420
Bewarse Legend Username: 420
Post Number: 11750 Registered: 12-2006 Posted From: 212.159.240.81
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 4:54 am: |
|
Ravanabrahma:...we need to display table1.line_id, table1.serial_number if and only if all the table1.serial_numbers exists in table2 for a given line_id how to acheive this.
Oki Bemmi Bedar .. I got your drift .. here is the answer .. this is based on process of ellimination trick .. there is an another trick using cartesian product .. SELECT LINE_ID,SERIAL_NUMBER FROM TABLE1 WHERE LINE_ID NOT IN (SELECT LINE_ID FROM ( SELECT LINE_ID, COUNT (LINE_ID) FROM (SELECT DISTINCT LINE_ID, SERIAL_NUMBER_FOUND FROM (SELECT LINE_ID, SERIAL_NUMBER, (SELECT COUNT ( * ) FROM Table2 t2 WHERE T2.SERIAL_NUMBER = T1.SERIAL_NUMBER) SERIAL_NUMBER_FOUND FROM Table1 t1)) GROUP BY LINE_ID HAVING COUNT (LINE_ID) > 1)) Knit India,do not split India !
|
Suyodhana
Yavvanam Kaatesina Bewarse Username: Suyodhana
Post Number: 1646 Registered: 06-2007 Posted From: 117.195.143.247
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 2:29 am: |
|
deeni meeda db'ers work cheste bemmam annai doookudu threads meeda work chestadu tasmaaat jagratta |
Ravanabrahma
Bewarse Legend Username: Ravanabrahma
Post Number: 15971 Registered: 06-2004 Posted From: 98.151.191.253
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 12:45 am: |
|
eg: table1 line_id serial_number 1 2 1 3 Both 2, 3 serial_numbers exists in table2..so we get should get the data as line_id, serial_number with the above rows. eg: line_id serial_number 2 4 2 5 and serial_number 5 doesn't exists in table2. then 0 rows should be displayed for the given line_id 2 |
Ravanabrahma
Bewarse Legend Username: Ravanabrahma
Post Number: 15970 Registered: 06-2004 Posted From: 98.151.191.253
Rating: N/A Votes: 0 (Vote!) | Posted on Monday, June 27, 2011 - 12:43 am: |
|
Penkonda_tiger:
simple ga cheppalante 2 tables unnay..2 tables had the column serial_number.. table1 had the columns line_id, serial_number and table 2 had the column serial_number. we need to display table1.line_id and table1.serial_number line_id 1 may have 10 rows with 10 different serail_numbers...we need to display table1.line_id, table1.serial_number if and only if all the table1.serial_numbers exists in table2 for a given line_id how to acheive this. |
Penkonda_tiger
Mudiripoyina Bewarse Username: Penkonda_tiger
Post Number: 4972 Registered: 06-2005 Posted From: 82.157.134.169
Rating: N/A Votes: 0 (Vote!) | Posted on Sunday, June 26, 2011 - 11:34 pm: |
|
Question understand beat me tight .. kanapade nijam: Good manners , kanapadanidhi: abusive language
|
Ravanabrahma
Bewarse Legend Username: Ravanabrahma
Post Number: 15969 Registered: 06-2004 Posted From: 98.151.191.253
Rating: N/A Votes: 0 (Vote!) | Posted on Sunday, June 26, 2011 - 7:23 pm: |
|
thanks stewie..aagu chostha |
Stewie
Pilla Bewarse Username: Stewie
Post Number: 180 Registered: 03-2011 Posted From: 24.147.86.254
Rating: N/A Votes: 0 (Vote!) | Posted on Sunday, June 26, 2011 - 7:14 pm: |
|
idemmana try cheyyi .. ante basically both tables match chesi count choostam.. select line_id , count(distinct serial_number) cnt from c , (select count(a.serial_number) cnt from (select distinct serial_number from t1) a, (select distinct serial_number from t2) b where a.serial_number = b.serial_number and t1.line_id = c.line_id )d where c.cnt = d.cnt group by line_id |
Stewie
Pilla Bewarse Username: Stewie
Post Number: 179 Registered: 03-2011 Posted From: 24.147.86.254
Rating: N/A Votes: 0 (Vote!) | Posted on Sunday, June 26, 2011 - 7:08 pm: |
|
Same ilantide appudeppudo evaro adigaru .. DB lo appudu ochindi answer last ki.. can we research ? |
Ravanabrahma
Bewarse Legend Username: Ravanabrahma
Post Number: 15968 Registered: 06-2004 Posted From: 98.151.191.253
Rating: N/A Votes: 0 (Vote!) | Posted on Sunday, June 26, 2011 - 5:41 pm: |
|
endadi ardam kaala..aagu try chestha ardam chesukovataniki |
Gochi
Bewarse Legend Username: Gochi
Post Number: 73575 Registered: 07-2004 Posted From: 148.168.40.4
Rating: N/A Votes: 0 (Vote!) | Posted on Sunday, June 26, 2011 - 4:58 pm: |
|
SELECT a.CreationDate, CASE WHEN a.Value = 1 THEN b.Name ELSE c.Name END FROM tableA a LEFT JOIN tableB b ON b.Id = a.Value AND a.Value = 1 LEFT JOIN tableC c ON c.Id = a.Value AND a.Value <> 1 eee typelo edanna try cheyyi hemesh... bongulo signature...manaki avasaramaaa
|
Ravanabrahma
Bewarse Legend Username: Ravanabrahma
Post Number: 15967 Registered: 06-2004 Posted From: 98.151.191.253
Rating: N/A Votes: 0 (Vote!) | Posted on Sunday, June 26, 2011 - 4:29 pm: |
|
Gochi:
appudu false annattu...2nd post lo cheppinattu..nenu table3 tho table1 vi validate chesthunna..adi eppudu ravali ante table1 lo unna serial numbers anni table2 lo undali lekapothe total validation returns 0 rows.. |
Gochi
Bewarse Legend Username: Gochi
Post Number: 73574 Registered: 07-2004 Posted From: 70.44.12.183
Rating: N/A Votes: 0 (Vote!) | Posted on Sunday, June 26, 2011 - 4:27 pm: |
|
Ravanabrahma:Now I need to have a validation that if table 1 line_id 1's seril_numbers are not in table 2 then return now rows..if all the serial_numbers exists for line_id then return 1
idartham kaaledhi...table 1 lo undi table 2 lo lekapothe em cheyyaali...? anni unte em cheyyaali... bongulo signature...manaki avasaramaaa
|
Ravanabrahma
Bewarse Legend Username: Ravanabrahma
Post Number: 15966 Registered: 06-2004 Posted From: 98.151.191.253
Rating: N/A Votes: 0 (Vote!) | Posted on Sunday, June 26, 2011 - 4:10 pm: |
|
select .. from table3, table1 where table3.columnx = table1.coumny and exists (select 1 from table2 where XYZ) What should be that XYZ..return 1 only when all the serial_numbers for line_id 1 in table2) |
Ravanabrahma
Bewarse Legend Username: Ravanabrahma
Post Number: 15965 Registered: 06-2004 Posted From: 98.151.191.253
Rating: N/A Votes: 0 (Vote!) | Posted on Sunday, June 26, 2011 - 4:05 pm: |
|
I have two tables.. I have 3 rows in table 1 and has column serial_number Table 2 is list of all the serial numbers. Table1 columns data line_id Serail_number 1 123 1 234 1 345 Table 2 column data serial_number 123 234 345 456 567 678 789 890 etc Now I need to have a validation that if table 1 line_id 1's seril_numbers are not in table 2 then return now rows..if all the serial_numbers exists for line_id then return 1..how to do this validation? |