能否请您帮助我使用SQL语句来查找第一个Select语句和第二个Select语句中存在的重复名称。
例如: 我需要查找第1班或第3班是否有同名学生。
select firstname from College where classid = 1
第二个select语句是:
select firstname from College where classid in (2, 3)
如果任何名称都有匹配的出现,那么我想选择该记录。
答案 0 :(得分:1)
答案 1 :(得分:1)
加入可能是一种选择
AutoCompleteTextField(
focusNode: pincodeFocus,
decoration: InputDecoration(
errorText: pincode.text == '' ? 'Null' : null,
border: InputBorder.none,
prefixIcon: Icon(Icons.home),
hintText: "Pincode",
),
controller: pincode,
itemSubmitted: (item) {
setState(() {
pincode.text = item.toString();
textField.controller.text = item.toString();
print('item submitted' + item.toString());
});
},
key: key,
suggestions: suggestionList,
itemBuilder: (context, item) {
return Container(
padding: EdgeInsets.all(20.0),
child: Row(
children: <Widget>[
Text(
item,
style: TextStyle(color: Colors.black),
)
],
),
);
},
itemSorter: (a, b) {
return a.compareTo(b);
},
itemFilter: (item, query) {
return item
.toLowerCase()
.toString()
.startsWith(query.toLowerCase());
},
),
或者,您也可以尝试使用select a.firstname
from
(
select firstname from College where classid = 1
)a join (
select firstname from College where classid in(2,3)
)b on a.firstname=b.firstname
exists
答案 2 :(得分:0)
一种非常简单的基于集合的方法是使用public async Task<IActionResult> Online([FromForm]CandidaturaAddModel model)
{
var formContent = new MultipartFormDataContent();
formContent.Add(new StringContent(model.Senha), "Senha");
formContent.Add(new StringContent(System.Text.Json.JsonSerializer.Serialize(model.AnoLectvo)), "AnoLectvo");
//...
//for other properties, such as Email, Genero etc
//...
formContent.Add(new StreamContent(model.Foto.OpenReadStream()), "Foto", Path.GetFileName(model.Foto.FileName));
_httpClient.BaseAddress = new Uri("https://localhost:xxxx/");
var response = await _httpClient.PostAsync("/api/xxx/CandidaturaAdd", formContent);
if (response.IsSuccessStatusCode)
{
//....
}
:
intersect