Dibatalkan

MySQL Last Distinct row

I've got a table with some duplicate entries, I've been trying different query combinations but I've been unable to solve

this problem.

Here is an example of my problem

[url removed, login to view]

Basically I would like to get the last distinct value (entry id: 9634), I've got many item_id's with duplicate field_value's.

Payment will be provided as soon as confirmed as working.

I've attached the table layout, I want a query that will select the latest unique value for item_id and field_id.

So the query would display these results
entry_id field_id item_id field_value
2 1 1 424
4 2 1 432434
6 1 2 4324
8 2 2 4324324

I can pay with Paypal once I confirm code is working as I want. So far I'm using this query
SELECT DISTINCT field_id, item_id, MIN(entry_id) as entry_id, MIN(field_value) as field_value FROM values2 WHERE item_id!='0' GROUP BY field_id, item_id ORDER BY item_id, field_id ASC

but that is pulling the first distinct values not the latest/last distinct values like I want.

Michael

Kemahiran: PHP

Lihat lebih lanjut: mysql distinctrow, distinctrow mysql, mysql distinct, mysql select distinctrow, mysql last, mysql last group, mysql select last distinct, mysql last row, select distinctrow mysql, mysql distinct last, mysql distinct latest, distinct mysql, mysql view distinctrow, mysql last distinct, mysql group last row, mysql last row group, distinct mysql last row, mysql distinct day, last row group php, mysql select last row value row, getting last row affected query php, usar distinctrow mysql, mysql select last rows, mysql query latest time distinct, mysql view last row php

Tentang Majikan:
( 0 ulasan ) Wokolena, Australia

ID Projek: #332085

5 pekerja bebas membida secara purata $63 untuk pekerjaan ini

NiGhTTraX

Hello. I can solve the problem for you in a very short time. Please give me a chance to help you. Thanks.

$35 USD dalam sehari
(9 Ulasan)
3.7
BenjaminLacy

No problem happy to help you

$50 USD dalam 0 hari
(0 Ulasan)
0.0
iraz

i can solve this problem... lets start this

$150 USD dalam sehari
(0 Ulasan)
0.0
robbynep

Hello. Let's start.

$30 USD dalam sehari
(0 Ulasan)
0.0
SParsloe

I've got a couple of solutions here for you, one that I have optimised for speed, and the other for usability. I'm a SQL DBA and MCSD - I'm pretty good at this kind of stuff.

$50 USD dalam sehari
(0 Ulasan)
0.0