| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| satyenderd Beginner
 
 
 Joined: 26 Aug 2005
 Posts: 144
 Topics: 73
 
 
 | 
			
				|  Posted: Fri Jul 18, 2008 11:57 am    Post subject: SQL QUERY PROBLEM |   |  
				| 
 |  
				| Hi All, 
 Herein I am getting a problem.
 
 I am quering a table in the below mentioned way:
 
 SELECT COUNT(*)
 FROM
 TABLE1;
 ---------+---------+---
 
 ---------+---------+---
 0
 
 
 
 SELECT *
 FROM
 TABLE1;
 ---------+---------+---------+---------+---------+---------+---
 RID   OPSEQ  OPCODE      OPCOMB  OPHOURS     OPTECHID
 ---------+---------+---------+---------+---------+---------+---
 1       1  860991                  1.5    709051650
 2       1  001013                  2.0    533730792
 3       1  001013                  2.0    533730792
 
 
 and I am getting the data when I am using the above query with Select * but not giving the count if i am giving SELECT COUNT(*)
 
 Please suggest me.
 _________________
 Satya
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| satyenderd Beginner
 
 
 Joined: 26 Aug 2005
 Posts: 144
 Topics: 73
 
 
 | 
			
				|  Posted: Fri Jul 18, 2008 1:49 pm    Post subject: |   |  
				| 
 |  
				| found the answer.. _________________
 Satya
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Terry_Heinze Supermod
 
 
 Joined: 31 May 2004
 Posts: 391
 Topics: 4
 Location: Richfield, MN, USA
 
 | 
			
				|  Posted: Fri Jul 18, 2008 11:28 pm    Post subject: |   |  
				| 
 |  
				| Please share the solution for our benefit. _________________
 ....Terry
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| satyenderd Beginner
 
 
 Joined: 26 Aug 2005
 Posts: 144
 Topics: 73
 
 
 | 
			
				|  Posted: Mon Jul 21, 2008 10:56 am    Post subject: |   |  
				| 
 |  
				| Terry, 
 I was asking if anyone found the answer. Sorry, If it meant that I found the answer.
 
 What I did was I ran Runstats.
 But no effect.
 _________________
 Satya
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| jsharon1248 Intermediate
 
 
 Joined: 08 Aug 2007
 Posts: 291
 Topics: 2
 Location: Chicago
 
 | 
			
				|  Posted: Mon Jul 21, 2008 11:22 am    Post subject: |   |  
				| 
 |  
				| If you get 3 rows in the SELECT *, you should get 3 as the result of SELECT COUNT(*).  I saw something similar a long time ago with a huge table that was resolved by running a reorg. |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| satyenderd Beginner
 
 
 Joined: 26 Aug 2005
 Posts: 144
 Topics: 73
 
 
 | 
			
				|  Posted: Mon Jul 21, 2008 1:06 pm    Post subject: Thanks Sharon |   |  
				| 
 |  
				| Thanks I will reorg and see if the problem gets solved. _________________
 Satya
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  | 
	
		|  |