- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
您好,我这样做是为了获取成员(member)的付款方式类型现金的详细信息
SELECT members.member_Id, members.member_Lastname, members.member_Firstname, members.member_PostCode,
members.member_Reference, members.member_Dob,30*memberToMship_ChargePerPeriod/DateDiff(memberToMship_EndDate, memberToMship_StartDate) As monthly_amount, mshiptypes.mshipType_Name, mshipstatustypes.mshipStatusType_Name,
membertomships.memberToMship_EndDate, IF(mshipOption_Period='year', TIMESTAMPDIFF (YEAR,memberToMship_StartDate, memberToMship_EndDate),
TIMESTAMPDIFF (MONTH ,memberToMship_StartDate,memberToMship_EndDate ) ) *memberToMship_ChargePerPeriod As Total
FROM members LEFT JOIN membertomships ON membertomships.member_Id = members.member_Id,
LEFT JOIN mshipstatustypes ON mshipstatustypes.mshipStatusType_Id = membertomships.mshipStatusType_Id,
LEFT JOIN mshipoptions ON mshipoptions.mshipOption_Id = membertomships.mshipOption_Id,
LEFT JOIN mshiptypes ON mshiptypes.mshipType_Id = mshipoptions.mshipType_Id,
WHERE membertomships.memberToMship_PayMethod='Cash'
AND members.member_Active LIKE 'y%'
AND (mshipstatustypes.mshipStatusType_Id='2'
OR mshipstatustypes.mshipStatusType_Id = '3'
OR mshipstatustypes.mshipStatusType_Id='6')"
和另一个类似的查询,用于使用支付方式类型卡获取成员(member)详细信息
SELECT members.member_Id, members.member_Lastname, members.member_Firstname, members.member_PostCode,
members.member_Reference, members.member_Dob,
30*memberToMship_ChargePerPeriod/DateDiff(memberToMship_EndDate, memberToMship_StartDate) As monthly_amount,
mshiptypes.mshipType_Name, mshipstatustypes.mshipStatusType_Name,
membertomships.memberToMship_EndDate,
IF(mshipOption_Period='year', TIMESTAMPDIFF (YEAR,memberToMship_StartDate, memberToMship_EndDate),
TIMESTAMPDIFF (MONTH ,memberToMship_StartDate,memberToMship_EndDate ) ) *memberToMship_ChargePerPeriod As Total
FROM members LEFT JOIN membertomships ON membertomships.member_Id = members.member_Id
LEFT JOIN mshipstatustypes ON mshipstatustypes.mshipStatusType_Id = membertomships.mshipStatusType_Id
LEFT JOIN mshipoptions ON mshipoptions.mshipOption_Id = membertomships.mshipOption_Id
LEFT JOIN mshiptypes ON mshiptypes.mshipType_Id = mshipoptions.mshipType_Id
WHERE membertomships.memberToMship_PayMethod='Card'
AND members.member_Active LIKE 'y%'
AND (mshipstatustypes.mshipStatusType_Id='2' OR mshipstatustypes.mshipStatusType_Id = '3'
OR mshipstatustypes.mshipStatusType_Id='6')"
但我想要成员(member)详细信息那些有付款方式的人是“现金和卡”(两种类型的成员(member))
有人会帮助解决这个问题吗...
我正在使用 MySQL
非常感谢..........
修改后的查询
SELECT members.member_Id, members.member_Lastname, members.member_Firstname, members.member_PostCode,
members.member_Reference, members.member_Dob,30*memberToMship_ChargePerPeriod/DateDiff(memberToMship_EndDate, memberToMship_StartDate) As monthly_amount, mshiptypes.mshipType_Name, mshipstatustypes.mshipStatusType_Name,
membertomships.memberToMship_EndDate,
IF(mshipOption_Period='year', TIMESTAMPDIFF (YEAR,memberToMship_StartDate, memberToMship_EndDate),
TIMESTAMPDIFF (MONTH ,memberToMship_StartDate,memberToMship_EndDate ) ) *memberToMship_ChargePerPeriod As Total
FROM members
INNER JOIN membertomships ON membertomships.member_Id = members.member_Id
INNER JOIN mshipstatustypes ON mshipstatustypes.mshipStatusType_Id = membertomships.mshipStatusType_Id
INNER JOIN mshipoptions ON mshipoptions.mshipOption_Id = membertomships.mshipOption_Id
INNER JOIN mshiptypes ON mshiptypes.mshipType_Id = mshipoptions.mshipType_Id
WHERE membertomships.memberToMship_PayMethod IN ('Card','Card','Cheque')
AND members.member_Active LIKE 'y%'
AND ( mshipstatustypes.mshipStatusType_Id='2' OR mshipstatustypes.mshipStatusType_Id = '3'
OR mshipstatustypes.mshipStatusType_Id='6');
但它没有显示正确的值..
您好,但有一个问题,我有 6 名持卡成员(member)和 3 名现金成员(member),分别显示 6 和 3,但当合并(卡和现金)时,它只会显示 4。但必须显示 (6+ 3) 我不知道怎么会这样请告诉任何解决方案。
最佳答案
假设唯一的支付类型是现金或卡,您可以省略 where 子句 membertomships.memberToMship_PayMethod='Card'
如果有其他支付方式,可以改成
membertomships.memberToMship_PayMethod in ('Card', 'Cash')
关于mysql - 试图同时获得卡和现金成员(member),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6897827/
我是 C++ 的新手,我在使用这段代码时遇到了问题: string output_date(int day, int month, int year){ string date; if
所以我这样做了 tar cvzf test.zip FP 为了创建目录 FP 的 zip 但是,它会列出 zip 中的目录 FP/ FP/php/ FP/php/pdf/ FP/php/docs/ F
我正在尝试在 Swift、Xcode 7.3(所以是 Swift 2.2)中创建一个通用类,但我似乎无法让它通过编译器: protocol Struct1Protocol { } struct Str
我的测试用例是这样的: class FooTest extends PHPUnit_Framework_TestCase { /** @covers MyClass::bar */ f
我正在尝试将brew install wine作为使electron-builder工作的一步。但是我所能得到的只是以下响应: ==> Installing dependencies for wine
我这样做: string[,] string1 = {{"one", "0"},{"Two", "5"},{"Three","1"}}; int b = 0; for(int i = 0; i <=
我正在尝试使用 SetWindowsHookEx 键盘 Hook Notepad.exe。 如您所见,工作线程正在将其 ASCII 代码(即 wParam)发送到指定的服务器。 UINT WINAPI
我正在尝试将 ListView 实现到我的 Fragment 中,但无论我尝试什么,我都会得到一个 NullPointerException。我检查对象是否为 null 并记录是否为 null,看起来
我尝试在一行中对齐两个 div。使用 float left 属性,一切顺利。但是当我在 div 中使用图像时,它开始产生问题。 所以这是我的示例代码:- Some headi
我目前正在使用此代码来获取图像的灰度图像表示并以 (512, 370, 1) 的格式表示它大批。 img_instance = cv2.imread(df.iloc[i][x_col]) / 255.
总结 我正在创建一个简单的应用程序,它允许用户选择一个包含顶级窗口的进程。用户首先键入 native DLL(而非托管 DLL)的路径。然后用户键入将在 Hook 过程中调用的方法的名称。该方法不得返
我是一名优秀的程序员,十分优秀!