| Author |
Topic |
|
dhani
Posting Yak Master
132 Posts |
Posted - 2009-07-24 : 18:29:07
|
| Hello All,is there any trick to solve this? seems to be something exist but unable to catchup...., please kindly help me....i have one empt table in DB, it has pleantly of records, number ofrecords changes everyday(addnew , or delete some.. etc)how to display the no of rows as the bottom of the valuefor example i have emp table with below dataEmpID, Ename, Sal, City, HasDL------------------------------101,Kirk,2000,NYC,Y102,Clarie,4000,BOSTON,Y103,Sinit,6000,CHICAGO,Y104,Sommu,7000,ARPII,N105,Bomu,9000,DUMMU,Nhow can i show as below (format doesn't matter for the count)EmpID, Ename, Sal, City, HasDL------------------------------101,Kirk,2000,NYC,Y102,Clarie,4000,BOSTON,Y103,Sinit,6000,CHICAGO,Y104,Sommu,7000,ARPII,N105,Bomu,9000,DUMMU,NCount,5 itemsplease Help meThanks in advancedhani |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-07-25 : 03:12:21
|
| Where do you want to show the data?MadhivananFailing to plan is Planning to fail |
 |
|
|
ayamas
Aged Yak Warrior
552 Posts |
Posted - 2009-07-25 : 08:38:07
|
| Maybe thisselect col1,col2,col3 from yourtableunionselect '','Count',(select count(*)from yourtable) |
 |
|
|
dhani
Posting Yak Master
132 Posts |
Posted - 2009-07-26 : 16:18:38
|
| Thanks for your response Madhivanani want to show after the table rowsplease.... |
 |
|
|
dhani
Posting Yak Master
132 Posts |
Posted - 2009-07-26 : 16:20:30
|
| Hi ayamas,Thanks for your response, is it is possible as a single query altogether because i am using some tool which takes only from part of sql query so it is fits as a single query (i mean single from clause) please....Thanks for your previous answer, Best Regardsdhani |
 |
|
|
ayamas
Aged Yak Warrior
552 Posts |
Posted - 2009-07-27 : 00:40:48
|
quote: Originally posted by dhani Hi ayamas,Thanks for your response, is it is possible as a single query altogether because i am using some tool which takes only from part of sql query so it is fits as a single query (i mean single from clause) please....Thanks for your previous answer, Best Regardsdhani
Maybe used a derived queryselect * from (select col1,col2,col3 from yourtableunionselect '','Count',(select count(*)from yourtable))tor use a temp table & insert the resultset of the union query in the temp table. |
 |
|
|
dhani
Posting Yak Master
132 Posts |
Posted - 2009-07-27 : 13:33:08
|
| Hi Ayamas,Thanks for your answer,i execute below query the result is fine but it seems to be that i need to pass some date in union query, in the count row i would like to show just count word (in first column) and count value in last column is it possible? (i tried by giving just passing empty string it didn't work, ofcourse because different data types but if i pass a date then it displays tha date which is a little bit awkwarding.... any idea please)select * from (select id,date,value from t1union allselect '','2/2/2008',(select count(*)from t1) as zeco)t----------------------and also you suggested in previous post use temp table & insert the result can you breif it if it is possible pleaseThanks in advance ayamas,Best Regardsdhani |
 |
|
|
ayamas
Aged Yak Warrior
552 Posts |
Posted - 2009-07-28 : 02:41:29
|
| Please post some sample data & the expected output.It will let me or anyone else understand your requirements better.Please have a look at this on how to post your sample data.http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx |
 |
|
|
|
|
|