473,395 Members | 1,442 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

For every value (column a) return * where column b is maximum

I have 4 columns a ,b ,c, d

sample data

a | b | c | d |

1 | 1 | 101 | 0
2 | 1 | 101 | 0
3 | 1 | 101 | 1
4 | 1 | 102 | 0
5 | 1 | 102 | 0
1 | 2 | 101 | 0
2 | 2 | 101 | 1

Write a SQL command such that it should return those rows where for every value of c in b, return rows with maximum a

i.e
Expect output

a | b | c | d |

3 | 1 | 101 | 1
5 | 1 | 102 | 0
2 | 2 | 101 | 1
Jul 11 '20 #1
1 3369
Banfa
9,065 Expert Mod 8TB
And what have you already tried?
Jul 12 '20 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: R. Santiago | last post by:
I have a table cc_rd_user_questions with the following columns: NUM NUMBER (25) DEFAULT 1 NOT NULL, COMPANY_ID NUMBER (15) NOT NULL, PROJ_ID NUMBER (15) NOT NULL, SEQ ...
11
by: Randell D. | last post by:
Folks, I have a table of addresses and a seperate table with contact names - All addresses tie to one or more names - I would like to keep track of the number of names 'belonging' to an address...
3
by: Prabhudhas Peter | last post by:
I want to assign null value to a column in the database which is decalred as an integer from VB.net... Is there any specific keyword like vbNull as in vb 6.0. -- Peter...
0
by: ChuckB | last post by:
How would one fill a datagrid column by column? I have a function that propagates an array, as array1 runs I want to have the values fill column 1, when it completes, array2 runs and fills...
1
by: orenl | last post by:
I have a DataRow (from DataTable) and i want to get data from a column name that might not exist. public static object getObject(DataTable dataTable, int index, string columnName) { return...
2
by: Mariano | last post by:
Greetings, pls help me friends...somebody knows how could I see the value of a cell belong to invisible column in gridview? I have a table with fields like that : name, last name, address. I show...
1
by: Octo Siburian | last post by:
I have been collecting data from ms.access database into a class object '_Get and put in data from database Fingerprint(RAS) into CPresensiFingerprint Public Function GetdbFingerprint() As...
1
irwansyahazniel
by: irwansyahazniel | last post by:
I want to calculate total value in index , previous value is 0, but I have replaced and display it with the calculation result “1/y”, and when I calculate total value, value that summed is previous...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.