vascobrito
Technical User
Hello there
i have a table with 3 fields
product_id, product_num, and product_date
each product_id has several product_num, each one with a product_date.
table Products
Product_id | Product_num | Product_date
1602 1032 19990226
1602 1033 19990530
1602 1056 20000617
1605 0027 20010325
1605 0032 20020914
1607 3206 20040330
Now, my problem is that i need to get the small Product_num of each Product_id if the small Product_num has a Product_date biger then 20020101.
I was trying to use somthing like this:
"select Product_id,min(Product_num) from Products group by Product_id having Product_date >= 20020101"
This doesn't work, because it get's the small Product_num of each Product_id but without considering the Product_date.
How can i do this?
Thanks in advance
i have a table with 3 fields
product_id, product_num, and product_date
each product_id has several product_num, each one with a product_date.
table Products
Product_id | Product_num | Product_date
1602 1032 19990226
1602 1033 19990530
1602 1056 20000617
1605 0027 20010325
1605 0032 20020914
1607 3206 20040330
Now, my problem is that i need to get the small Product_num of each Product_id if the small Product_num has a Product_date biger then 20020101.
I was trying to use somthing like this:
"select Product_id,min(Product_num) from Products group by Product_id having Product_date >= 20020101"
This doesn't work, because it get's the small Product_num of each Product_id but without considering the Product_date.
How can i do this?
Thanks in advance