Design a site like this with WordPress.com
Get started

SQL Query Multiple Columns Using Distinct on One Column Only

Solution

select ID, Category from t_Con_ChargesAmount where
 ID in (Select max(ID) FROM t_Con_ChargesAmount group by Category)

Explanation

This query will select ID and Category from the table and the Category will be distinct now.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at WordPress.com.

Up ↑

%d bloggers like this: