Author |
Message |
Nayakudu
Desanike Pedda Bewarse Username: Nayakudu
Post Number: 7408 Registered: 05-2005 Posted From: 129.188.69.129
Rating:N/A Votes: 0(Vote!) | Posted on Friday, April 13, 2007 - 2:02 pm: | |
cool buddy ante mana daggarike |
Nks
Pilla Bewarse Username: Nks
Post Number: 97 Registered: 08-2004 Posted From: 38.101.49.150
Rating:N/A Votes: 0(Vote!) | Posted on Friday, April 13, 2007 - 1:57 pm: | |
maa manager ku query isthe ippudu vadhule DWH team choosukuntundhi manaku sambandham ledhu annadu |
Nayakudu
Desanike Pedda Bewarse Username: Nayakudu
Post Number: 7407 Registered: 05-2005 Posted From: 129.188.69.129
Rating:N/A Votes: 0(Vote!) | Posted on Friday, April 13, 2007 - 1:55 pm: | |
Tmbuff mama he is using SQL server so those row_num() may not be available in SQL server |
Tmbuff
Pilla Bewarse Username: Tmbuff
Post Number: 162 Registered: 04-2004 Posted From: 159.153.4.51
Rating:N/A Votes: 0(Vote!) | Posted on Friday, April 13, 2007 - 1:52 pm: | |
Nks - User the query I provided. It should give you good performance if the volume of the table is high. |
Nayakudu
Desanike Pedda Bewarse Username: Nayakudu
Post Number: 7401 Registered: 05-2005 Posted From: 136.182.158.129
Rating:N/A Votes: 0(Vote!) | Posted on Friday, April 13, 2007 - 12:33 pm: | |
nenu ichhinadi work cheyyatam ledaa |
Proofdada
Bewarse ke Bewarse! Username: Proofdada
Post Number: 53936 Registered: 03-2004 Posted From: 80.121.144.9
Rating:N/A Votes: 0(Vote!) | Posted on Friday, April 13, 2007 - 8:56 am: | |
nenu complex stmt lu yeppudu use seyyaleedhu...anni arrays looki read seeseukuni sorting sesukuntaa.. nannnu aaapadddu.... |
Nks
Pilla Bewarse Username: Nks
Post Number: 96 Registered: 08-2004 Posted From: 38.101.49.150
Rating:N/A Votes: 0(Vote!) | Posted on Friday, April 13, 2007 - 8:53 am: | |
thanks mamalu vamsam_fan ichina query work iyindhi. andhariki chala chala thanks. |
Gaali
Bewarse ke Bewarse! Username: Gaali
Post Number: 12151 Registered: 03-2004 Posted From: 71.128.217.70
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 11:49 pm: | |
16th midnight kalla tax returns file cheyyali mama. Vaati meda kusthee paduthunna. Madhyalo break teesukonna.
|
Netman
Pilla Bewarse Username: Netman
Post Number: 122 Registered: 03-2004 Posted From: 59.93.112.5
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 11:48 pm: | |
అల్లుడూ అంత పరాచికాలు వద్దులే! ఏమిటీ సంగతులు? ఇంకా నిదుర టైం అవ్వలేదా? |
Gaali
Bewarse ke Bewarse! Username: Gaali
Post Number: 12146 Registered: 03-2004 Posted From: 71.128.217.70
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 11:42 pm: | |
Netman mama Meeru Bezawada lo SQL coaching center open cheyyandi.
|
Andhramass
Bewarse ke Bewarse! Username: Andhramass
Post Number: 14984 Registered: 07-2006 Posted From: 203.26.122.12
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 11:36 pm: | |
okk nenu wrong sequence lo open chesannu i will try today మాస్ అంటే ఇష్టం, బెజవాడ అంటే ప్రాణం |
Andhramass
Bewarse ke Bewarse! Username: Andhramass
Post Number: 14983 Registered: 07-2006 Posted From: 203.26.122.12
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 11:36 pm: | |
AM Are you in Vijayawada? I am now in Vijayawada. ledhu aus lo vunnaaaa? holidays ki vacharaaaa? మాస్ అంటే ఇష్టం, బెజవాడ అంటే ప్రాణం |
Netman
Pilla Bewarse Username: Netman
Post Number: 121 Registered: 03-2004 Posted From: 59.93.112.5
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 11:28 pm: | |
AM Are you in Vijayawada? I am now in Vijayawada. You have to start IM window with one of your online contacts in Yahoo Messenger8.1 or GoogleTalk. Then you shouldopen my my application and start typing in that. For sending you need to hit 'enter' in my application itself. |
Andhramass
Bewarse ke Bewarse! Username: Andhramass
Post Number: 14978 Registered: 07-2006 Posted From: 203.26.122.12
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 11:21 pm: | |
netmama merru chepina software instal chessaa after that gtalk or YM open chesiii mee tool lo telugu type chesi enter anni clik chesthey ravatham ledhu yenduku? మాస్ అంటే ఇష్టం, బెజవాడ అంటే ప్రాణం |
Netman
Pilla Bewarse Username: Netman
Post Number: 119 Registered: 03-2004 Posted From: 59.93.112.5
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 11:15 pm: | |
NKS Assuming, TEMP is table name and INo is auto-increasing value, find the Maximum of INO with Select max(Ino) from Temp Then Select the ClassID of the Maximum INo, since this is not a fixed one and may be 5, 6, 7.. like that. Select Ino as MxIno, ClassID as MxClassID from Temp where Ino= ( Select max(Ino) from Temp) So, now select all records whose INO is (Maximum Ino- Maximum ClassID) Final Query is: SELECT Temp.* FROM Temp, [select Ino as MxIno, ClassID as Mxclassid from Temp where INO= (SELECT max(Ino) FROM temp)]. AS Mxtemp WHERE Ino> MxIno-Mxclassid; This is Access SQL syntax. I am not sure about SQL2000 syntax for 'Max' function. Use help and see whether this hold good. |
Nks
Pilla Bewarse Username: Nks
Post Number: 95 Registered: 08-2004 Posted From: 68.38.177.133
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 6:45 pm: | |
oops sorry mamalu nenu SQL Server 2000 lo try chesthunna andhulo error vasthondhi. repu morning officec ku vellaka mari try chestha. andhariki chala thanks |
Vamsam_fan
Pilla Bewarse Username: Vamsam_fan
Post Number: 52 Registered: 02-2006 Posted From: 65.121.89.2
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 6:09 pm: | |
drop table t1; create table t1 ( ino integer, polID integer, classid integer, value integer); insert into t1 values(1, 100, 1, 10); insert into t1 values(2, 100, 2, 3 ); insert into t1 values(3 ,100, 3 ,1 ); insert into t1 values(4, 100, 4 ,4 ); insert into t1 values(5, 100, 5 ,3 ); insert into t1 values(6, 100, 1 ,34 ); insert into t1 values(7, 100, 2 ,32 ); insert into t1 values(8, 100, 3 ,43 ); insert into t1 values(9, 100, 4 ,8 ); insert into t1 values(10, 100, 5 ,10 ); insert into t1 values(11, 100, 1 ,1 ); insert into t1 values(12, 100, 2 ,5 ); insert into t1 values(13, 100, 3 ,8 ); insert into t1 values(14, 100, 4 ,5 ); insert into t1 values(15, 100, 5, 9 ); commit; select * from t1 where ino in ( select max(ino) as ino from t1 group by classid ) |
Tmbuff
Pilla Bewarse Username: Tmbuff
Post Number: 161 Registered: 04-2004 Posted From: 159.153.4.51
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 4:31 pm: | |
You can use this -- SELECT * FROM (SELECT INO, PolID, ClassID, Value, ROW_NUMBER() OVER (PARTITION BY CLASSID ORDER BY INO DESC) RN FROM TABLE) WHERE RN =1 |
Beer
Vooriki Bewarse Username: Beer
Post Number: 2906 Registered: 09-2006 Posted From: 208.204.155.241
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 4:08 pm: | |
work avutundi... naku kooda no problem.. oracle version 9i.. Okkadunnadu |
Nayakudu
Desanike Pedda Bewarse Username: Nayakudu
Post Number: 7368 Registered: 05-2005 Posted From: 136.182.158.145
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 4:06 pm: | |
yemo naku work avuthundi |
Nayakudu
Desanike Pedda Bewarse Username: Nayakudu
Post Number: 7367 Registered: 05-2005 Posted From: 136.182.158.145
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 4:06 pm: | |
enduku vasthundi rakudadu kada |
Beer
Vooriki Bewarse Username: Beer
Post Number: 2905 Registered: 09-2006 Posted From: 208.204.155.241
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 4:06 pm: | |
enduku dorlings Okkadunnadu |
Nayakudu
Desanike Pedda Bewarse Username: Nayakudu
Post Number: 7366 Registered: 05-2005 Posted From: 136.182.158.145
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 4:03 pm: | |
|
Nks
Pilla Bewarse Username: Nks
Post Number: 94 Registered: 08-2004 Posted From: 38.101.49.150
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 3:59 pm: | |
nayakudu mama iam getting this error when i run ur query The ORDER BY clause is invalid in views, inline functions, derived tables, and subqueries, unless TOP is also specified. |
Nayakudu
Desanike Pedda Bewarse Username: Nayakudu
Post Number: 7360 Registered: 05-2005 Posted From: 136.182.158.145
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 3:53 pm: | |
no no previous one is the correct one with slight modification select * from (select * from table order by IdNo desc, order num asc, classID asc) tmp where tmp.rownum < (select count(distinct classid) from table where order_no = tmp.order_no) this should work if i am right |
Nayakudu
Desanike Pedda Bewarse Username: Nayakudu
Post Number: 7359 Registered: 05-2005 Posted From: 136.182.158.145
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 3:51 pm: | |
select * from (select * from table order by IdNo desc, order num asc, classID asc) tmp where tmp.rownum < (select count(distinct classid) from table where ID_no = tmp.id_no) this should list the latest ones for each order |
Nayakudu
Desanike Pedda Bewarse Username: Nayakudu
Post Number: 7356 Registered: 05-2005 Posted From: 129.188.69.145
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 3:41 pm: | |
ok here is the final query select * from (select * from table order by IdNo desc, order num asc, classID asc) tmp, table where tmp.Idno = table.Idno and tmp.rownum < (select count(distinct classid) from table where order_no = tmp.order_no) |
Beer
Vooriki Bewarse Username: Beer
Post Number: 2904 Registered: 09-2006 Posted From: 208.204.155.241
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 3:37 pm: | |
this will work select * from ( select * from table order by IDNO desc) where rownum <= select count(distinct classid) from tab); Okkadunnadu |
Nayakudu
Desanike Pedda Bewarse Username: Nayakudu
Post Number: 7355 Registered: 05-2005 Posted From: 129.188.69.145
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 3:36 pm: | |
evaru vachharu evaru phone chesaru asalu yemiti katha |
Nayakudu
Desanike Pedda Bewarse Username: Nayakudu
Post Number: 7354 Registered: 05-2005 Posted From: 129.188.69.145
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 3:36 pm: | |
|
Rratna
Desanike Pedda Bewarse Username: Rratna
Post Number: 6031 Registered: 03-2004 Posted From: 69.81.48.27
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 3:36 pm: | |
voorloki vachi call chesthe kaneesam phone kooda etha ledu kada Nayakudu mama . Idhi neeku dharmama? |
Nayakudu
Desanike Pedda Bewarse Username: Nayakudu
Post Number: 7353 Registered: 05-2005 Posted From: 129.188.69.145
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 3:35 pm: | |
is the number of distinct classID values per each order varies but no is fixed for an order .. correctena |
Nayakudu
Desanike Pedda Bewarse Username: Nayakudu
Post Number: 7352 Registered: 05-2005 Posted From: 129.188.69.145
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 3:34 pm: | |
oka order ki these many distinct class IDs ani fixed naa??? |
Nayakudu
Desanike Pedda Bewarse Username: Nayakudu
Post Number: 7351 Registered: 05-2005 Posted From: 129.188.69.145
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 3:33 pm: | |
so every order lo latest 123456 theyala ???? |
Nayakudu
Desanike Pedda Bewarse Username: Nayakudu
Post Number: 7350 Registered: 05-2005 Posted From: 129.188.69.145
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 3:33 pm: | |
will there be addition of values to classID down the line |
Nks
Pilla Bewarse Username: Nks
Post Number: 93 Registered: 08-2004 Posted From: 38.101.49.150
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 3:32 pm: | |
beer mama alanti scenario levu.... ClassID 1 2 3 4 5 6 . . . ala incremental ga vuntai and adhe order lo repeat avuthai |
Nayakudu
Desanike Pedda Bewarse Username: Nayakudu
Post Number: 7349 Registered: 05-2005 Posted From: 129.188.69.145
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 3:32 pm: | |
do you have any time stamp... does class ID always be only one of (1,2,3,4,5) |
Nks
Pilla Bewarse Username: Nks
Post Number: 92 Registered: 08-2004 Posted From: 38.101.49.150
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 3:31 pm: | |
hmm row_num < 6 ala hardcoded vundakudadhu. nenu just example kindha ala icha... there are around 100 rows and may increase |
Beer
Vooriki Bewarse Username: Beer
Post Number: 2903 Registered: 09-2006 Posted From: 208.204.155.241
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 3:29 pm: | |
kani this may not work all the time consider this scenario 1 100 1 10 2 100 2 3 3 100 3 1 4 100 4 4 5 100 5 3 6 100 1 34 7 100 2 32 8 100 3 43 9 100 4 8 10 100 2 5 11 100 1 1 12 100 5 10 13 100 3 8 14 100 4 5 15 100 5 9 Okkadunnadu |
Pda
Desanike Pedda Bewarse Username: Pda
Post Number: 8914 Registered: 06-2006 Posted From: 129.138.18.85
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 3:28 pm: | |
naakudu baa select * from ( select * from table order by INO desc) where row_num < 6 order by INO ASC aina tana kochen adi kadu anukunta.. Don't show me your attitude. _|_ have got my own. |
Nayakudu
Desanike Pedda Bewarse Username: Nayakudu
Post Number: 7348 Registered: 05-2005 Posted From: 136.182.158.145
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 3:27 pm: | |
kaka pothey data ekkuvunte kastamemo kada.. sorting cheyyalante first... |
Beer
Vooriki Bewarse Username: Beer
Post Number: 2902 Registered: 09-2006 Posted From: 208.204.155.241
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 3:27 pm: | |
chinna correction.. select * from ( select * from table order by IDNO desc) where rownum < 6 Okkadunnadu |
Beer
Vooriki Bewarse Username: Beer
Post Number: 2901 Registered: 09-2006 Posted From: 208.204.155.241
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 3:26 pm: | |
katti cheppavu nayak... too good Okkadunnadu |
Nayakudu
Desanike Pedda Bewarse Username: Nayakudu
Post Number: 7347 Registered: 05-2005 Posted From: 136.182.158.145
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 3:23 pm: | |
select * from ( select * from table order by IDNO desc) where row_num < 6
|
Nks
Pilla Bewarse Username: Nks
Post Number: 91 Registered: 08-2004 Posted From: 38.101.49.150
Rating:N/A Votes: 0(Vote!) | Posted on Thursday, April 12, 2007 - 3:14 pm: | |
naaku SQL lo kastha help cheyandi mamalu. INO, PolID, ClassID, Value ivi coloumns. INO anedhi Identity column. PolID anedhi foregin key. sample data INO PolID ClassID Value 1 100 1 10 2 100 2 3 3 100 3 1 4 100 4 4 5 100 5 3 6 100 1 34 7 100 2 32 8 100 3 43 9 100 4 8 10 100 5 10 11 100 1 1 12 100 2 5 13 100 3 8 14 100 4 5 15 100 5 9 andhulo class ID distinct values vachi 1,2,3,4,5 avi 3 times same order lo repeat iyyayi. naaku latest distinct class ID data motham kavali OUTPUT: 11 100 1 1 12 100 2 5 13 100 3 8 14 100 4 5 15 100 5 9 evarikanna theusthe kastha chepandi annalu |