04-06-17, 03:44 PM
اريد اختيار القيمة في الحقل المسمى debt بشرط اختيار اقصى سجل لل pay_id فكتبت الكود كالاتي:
Dim com3 As New SqlCommand("select max(pay_id),debt from table1 where name ='" & TextBox2.Text & "' ) ", con)
ولكن يعطي الخطأ الأتي
Column 'table1.debt' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
Dim com3 As New SqlCommand("select max(pay_id),debt from table1 where name ='" & TextBox2.Text & "' ) ", con)
ولكن يعطي الخطأ الأتي
Column 'table1.debt' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.