Home » SQL & PL/SQL » SQL & PL/SQL » Oracle sql id count (Oracle, 11G)
Oracle sql id count [message #658878] Thu, 29 December 2016 08:21 Go to next message
Aleks21
Messages: 1
Registered: December 2016
Junior Member
In my table there are rows
Example table
ID, Employee
01, Employee1
02, Employee1
03, Employee1
04, Employee2
05, Employee2
06, Employee2
07, Employee3
08, Employee3


After work of my sql request it shows more rows than it should be.
Perhaps the error at zero. How shoud I fix my sql request?

Result table:
Employee,ID
Employee1,3
Employee2,3
Employee3,2
  • Attachment: sql.txt
    (Size: 3.26KB, Downloaded 99 times)
Re: Oracle sql id count [message #658881 is a reply to message #658878] Thu, 29 December 2016 08:23 Go to previous messageGo to next message
BlackSwan
Messages: 25856
Registered: January 2009
Location: SoCal
Senior Member
Welcome to this forum

Please read and follow the forum guidelines, to enable us to help you:
OraFAQ Forum Guide
How to use {code} tags and make your code easier to read
Re: Oracle sql id count [message #658882 is a reply to message #658878] Thu, 29 December 2016 08:26 Go to previous messageGo to next message
John Watson
Messages: 7262
Registered: January 2010
Location: Global Village
Senior Member
Welcome to the forum. Please read our OraFAQ Forum Guide and How to use [code] tags and make your code easier to read

I don't understand what you are asking. What you call your result table looks like nothing more than a COUNT and a GROUP BY.

What is that attachment about?

[Updated on: Thu, 29 December 2016 08:26]

Report message to a moderator

Re: Oracle sql id count [message #658886 is a reply to message #658878] Thu, 29 December 2016 09:26 Go to previous message
Michel Cadot
Messages: 65387
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Welcome to the forum.
Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Indent the code, use code tags and align the columns in result.
Also always post your Oracle version, with 4 decimals, as solution depends on it.

With any SQL or PL/SQL question, please, Post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.

Previous Topic: display all numbers with like
Next Topic: query next value
Goto Forum:
  


Current Time: Thu Feb 22 19:44:27 CST 2018

Total time taken to generate the page: 0.13273 seconds