I am new to MySQL and need help with a query Here is some sample data with columns:
modelid styleid sequence
19463 316811 0
19463 316812 1
19463 316813 2
19463 316814 3
19463 316920 4
19463 316921 5
19727 318010 0
19727 318011 2
19727 318012 1
19727 318013 3
19884 320053 0
19884 320054 1
19884 320055 2
19884 320056 3
19998 321302 0
19998 321303 1
19998 321304 2
19998 321305 3
19998 321306 4
19998 321307 5
19998 321308 6
19998 321309 7
I need to get one styleid for every modelid, preferably with a sequence of 0 or 1, but the sequence does not really matter, it can be random.
The Best result would be something like this, CANT USE sequence = 0 as a where clause though:
modelid styleid sequence
19463 316811 0
19727 318010 0
19884 320053 0
Thanks