Select *
From
(
Select
M. mebname,
C. cardno,
M. mebid,
Px = row_number () over (partition by M. mebid order by newid ())
From
M_membermain as M (nolock)
Inner join
M_card as C (nolock) on M. mebid = C. mebid
Where
M. mebid in ({0 })
) As T
Where
Px <= 1
The preceding method can be used to group and retrieve any of them. Suitable for one-to-many relationships.
SQL learning ..
Select Top 100 * From gs_folio where folioid in (select folioid from ac_trans a left join ac_item B on A. Itemid = B. Itemid where B. Arrange = 'card ')
And folioid in (select folioid from ac_trans a left join ac_item B on A. Itemid = B. Itemid where B. Itemid = 2009)
Gs_folio one-to-multiple ac_trans one-to-one ac_item
If this problem is found, there will be cash expenditure and bank card transfers.
The landlord did not think about why CSHARP could parse JavaScript scripts,
So with the above code, we can actually make it easier ......
Introduce COM component Microsoft Script Control 1.0
Then the following code can be passed ......
Public static string exprtoval (string expr)
{
Msscriptcontrol. scriptcontrolclass SC = NULL;
SC = new msscriptcontrol. scriptcontrolclass ();
SC. Language = "JavaScript ";
Object OBJ = SC. eval (expr );
Return obj. tostring ();
}
Test:
Console. writeline (exprtoval ("1 + 2*(3 + 4 )"));
Datatable. conpute () can also be dynamically calculated