mysql find_in_set匹配2列

时间:2017-05-29 06:13:16

标签: mysql

我有一个查询工作,find_in_set像这样工作

$groupid = 245;
$formsidlist = '52,57,103,104,105,107,109,110';
$query = "SELECT * FROM #__immi_visaformfields WHERE 
FIND_IN_SET('$groupid','field_duplicate')  AND published='1' AND 
 FIND_IN_SET(formid,'$formsidlist') ORDER BY id";

现在我将formsidlist更改为

$formsidlist = '52-1,57-2,103-1,104-1,105-2,107-1,109-1,110-1';

从52-1开始,52应该与formid列进行比较,1应该与formversionid列进行比较。

我如何实现这一目标?

1 个答案:

答案 0 :(得分:1)

使用' - '和formversionid连接formid:

{
  "name": "ionic-hello-world",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/common": "4.1.0",
    "@angular/compiler": "4.1.0",
    "@angular/compiler-cli": "4.1.0",
    "@angular/core": "4.1.0",
    "@angular/forms": "4.1.0",
    "@angular/http": "4.1.0",
    "@angular/platform-browser": "4.1.0",
    "@angular/platform-browser-dynamic": "4.1.0",
    "@ionic-native/core": "3.6.1",
    "@ionic-native/device": "3.6.1",
    "@ionic-native/facebook": "^3.10.0",
    "@ionic-native/firebase": "^3.10.3",
    "@ionic-native/keyboard": "^3.10.3",
    "@ionic-native/splash-screen": "3.6.1",
    "@ionic-native/status-bar": "3.6.1",
    "@ionic/cli-plugin-cordova": "^1.2.0",
    "@ionic/cli-plugin-ionic-angular": "^1.2.0",
    "@ionic/storage": "2.0.1",
    "@ngrx/core": "^1.2.0",
    "@ngrx/store": "^2.2.1",
    "d3": "^4.7.4",
    "firebase": "^3.7.5",
    "ionic-angular": "3.2.1",
    "ionicons": "3.0.0",
    "moment": "^2.18.1",
    "pouchdb": "^6.1.2",
    "pouchdb-adapter-cordova-sqlite": "^2.0.2",
    "rxjs": "5.1.1",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.10"
  },
  "devDependencies": {
    "@ionic/app-scripts": "1.3.7",
    "@ionic/cli-plugin-cordova": "1.2.1",
    "@ionic/cli-plugin-ionic-angular": "1.2.0",
    "typescript": "~2.2.1"
  },
  "cordovaPlugins": [
    "cordova-plugin-whitelist",
    "cordova-plugin-console",
    "cordova-plugin-statusbar",
    "cordova-plugin-device",
    "cordova-plugin-splashscreen",
    "ionic-plugin-keyboard"
  ],
  "cordovaPlatforms": [
    "ios",
    {
      "platform": "ios",
      "version": "",
      "locator": "ios"
    }
  ],
  "description": "helloWorld: An Ionic project"
}