Quantcast
Channel: SCN : Unanswered Discussions - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 4343

COUNT(*) giving wrong results

$
0
0

Hi all,

     I am facing a very peculiar issue here. Will take it up with the help of queries -

 

 

 

SELECT COUNT(*) FROM table_name WHERE "column_name" = 'elec'

-- this is giving me 2 rows.

 

 

SELECT COUNT(*)

  FROM (

       SELECT * FROM table_name WHERE "column_name" = 'elec'

  );   

---this gives 731 rows which is the CORRECT value.

 

SELECT COUNT(*) FROM (

            SELECT * FROM table_name

              )

WHERE "column_name" = 'elec';

---this also gives 731 rows which is the CORRECT value.

 

 

I have no clue what is I am doing wrong here. It is happening for queries with a 'WHERE' clause. I looked at the PlanViz fir these two queries, but could not make anything out of it. Any help would be appreciated


Viewing all articles
Browse latest Browse all 4343

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>