"wojtek" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Then,  I have the following data in this Table:
> Id    IdMat     Partia  Ilosc  DelK
> 1    6    1457714    900    1
> 5    6    1457714    900    1
> 6    6    1457714    480    1
> 7    6    1476051    900    0
> 8    6    1476051    900    0
> 13    6    1476051    900    0
> 14    6    1479230    900    0
> 15    6    1479230    900    1
> 16    6    1479230    900    2
> 29    1    1454042    1000    1
> 30    1    1454042    1000    1
> 31    1    1454042    1000    1
> 32    1    1454042    1000    1
> 33    1    1454042    200    1
> 34    9    1475137    950    0
> 35    3    1458702    1000    1
> 36    5    1480710    900    0
> 50    4    1475907    900    1
> 51    4    1475907    900    1
> 52    6    1479230    900    1
> 53    6    1479230    900    1
> 54    6    1476051    900    0
> 55    6    1476051    900    0
> 56    6    1457714    900    0
> 57    6    1457714    900    0
> 58    6    1457714    900    0
> 59    6    1457714    900    0
> 60    6    1457714    900    0
>
> and as a result of the query I need to select a list of 'Partia'  for
> a choosen IdMat, that meens (example IdMat=6):
> Id      IdMat      Partia
> 1         6             1457714
> 7         6            1476051
> 14       6            1479230
> and of course 'Partia' number is selected only once.

select min(Id), IdMat, Partia
from Magazyn
where IdMat = 6
group by Partia;

Igor Tandetnik



_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to