小编Tom*_*uis的帖子

PostgreSQL 左连接查询对象数组聚合

我有2张桌子:

table "person" with columns: person_id, person_name
table "pet" with columns: pet_id, owner_id, pet_name

person data:
1, 'John'
2, 'Jill'
3, 'Mary'

pet data:
1, 1, 'Fluffy'
2, 1, 'Buster'
3, 2, 'Doggy'
Run Code Online (Sandbox Code Playgroud)

如何写SELECT查询语句从person左连接petperson_id = owner_id具有聚合函数,所以我的结果数据的样子:

1,[{pet_id:1,pet_name:'Fluffy'},{pet_id:2,pet_name:'Buster'}],'John'
2,[{pet_id:3,pet_name:'Doggy'}],'Jill'
3,[],'Mary'
Run Code Online (Sandbox Code Playgroud)

sql postgresql json aggregate-functions left-join

11
推荐指数
2
解决办法
4439
查看次数

Flutter GestureDetector onTap 不工作

当用户点击外部时,尝试使用 GestureDetector 使 TextFormField 失去焦点,但我无法让它工作。onTap 永远不会触发。

class EditScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: new GestureDetector(
        onTap: () {
          print('this does not fire, why???????????');

          // this is my attempt to unfocus textformfield when click away
          FocusScope.of(context).requestFocus(new FocusNode());
        },
        child: SingleChildScrollView(
          child: Column(
            children: <Widget>[
              TextFormField(
                maxLines: null,
              ),
            ],
          ),
        ),
      ),
    );
  }
}
Run Code Online (Sandbox Code Playgroud)

flutter flutter-layout

5
推荐指数
1
解决办法
7536
查看次数


如何将每个单词的首字母大写?

我需要一个任何语言的脚本来大写文件中每个单词的第一个字母.

感谢所有的答案.

Stackoverflow岩石!

language-agnostic scripting

2
推荐指数
3
解决办法
1万
查看次数