I have this table (REGIONS) with this sample values: Id Cod1 Cod2 Payed 1 0001 000A NULL 2 0001 000B YES 3 0001 000B YES 4 0001 000C NULL 5 0001 000C YELL 6 0001 000D NULL 7 0002 000A YES 8 0002 000C NULL 9 0002 000C NULL 10 0002 000C YES 11 0003 000C YES 12 0004 000C
Tag: count
Join count query into one
I have two very simple count queries that I would like to join into one. To clarify the situation I will add the tables I got: Book isbn author 1111 GB 2222 DC 3333 RL Author code Name GB George B. KL Kyle L. DC Donald C. RL Roland L. Coauthor name isbn KL 1111 GB 2222 GB 3333 And
Query to find the count of total IDs, and IDs having null in any column and the percentage of the two (i.e. Count of ID having null /total ID count)
There are two tables. Tables A has following structure ID Flag Name 1X 1 Y 2Y 0 Null 3Z 1 Null 4A 1 Y Table B has the following structure B_ID City State 1X Y Null 2Y Null Null 3Z Null Y 4A Y Y I want to get the count of all the IDs and the count of IDs
How to do MAX COUNT so Query returns 1 Result SQL
I have the following query: Which returns the following results: Id EmailDomain UserCount 1 @yahoo.com 1 1 @gmail.com 4 2 @hotmail.com 1 3 @aol.com 1 3 @comcast.com 1 I need the Ids and the Email Domains for a later query, but I don’t want multiple email domains. So I want my results to look like this: Id EmailDomain UserCount 1
Oracle SQL Developer – group by and count within specific date
SQL noob, trying to get some help grouping by unique name, providing a count, filtered for only start dates during 2021. This is what I have so far, and why I’m getting lost. my_table: Trying to get count of the Name, filtered for only 2021 start dates. This is what I want my output to look like: My code: But
Trying to get the 2 min(count()) with Ties
I allow myself to write a thread regarding a query I’m trying to make for hours now. I’m trying to get the name of the friend (friend.first_name) who refuses the most proposed dates for events. To do this I’m counting the number of proposed date and ORDER BY ASC. However, this does not take into account TIES. What I’m looking
SQL only show orders with one order row. if more rows don display anything
i´m trying to search for orders with one specific article on the order row, but if there more than one row i don´t want to see any of the rows. This is a sample of two orders where i only want to get one resault. order 9891026 has two rows and 9891025 only have one row. result order_no line_no 9891026
Count total day difference in a Pivot SQL
I have data in two tables with dates PAL date and HUB date. I’m looking to show the number of day difference in a table with 6 columns: Client 1day 2days 3days 4days 5days Client will display the clients grouped, 1 Day will display the count of how many datediff of 1. 2 Days will display the count of how
Find duplicate values in a field results in multiple rows of the same values
Suppose this table I want to get all CODEs where SIZEPOS has the same value more than once… So for the product I would like to get ‘194342-01’, 10510, 5 as SIZEPOS 5 appears twice. I achieved it with the following query but for some reason some of the returned rows appear twice, or even three times… What am I
How does one get the total rows for a partition in postgresql
I’m using a windows function to help me pagination through a list of records in the database. For example I have a list of dogs and they all have a breed associated with them. I want to show 10 dogs from each breed to my users. So that would be That will give me ~ten dogs from each breed.. What