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 1404 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: 26766
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: 8929
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: 68641
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: Fri Apr 19 22:11:49 CDT 2024