如何将Google电子表格链接到PostgreSQL?我用谷歌搜索并获得了一些MySQL的示例代码,以及一些产品.根据此链接,对少数数据库存在支持.
我试图从一个特定列为NULL的表中获取所有记录.但我没有得到任何记录.另一方面,有许多记录,其中长度(字段)确实为0.
select count(*) from article a where length(for_interest) =0;
count
-------
9
(1 row)
select count(*) from article a where for_interest is NULL ;
count
-------
0
(1 row)
Run Code Online (Sandbox Code Playgroud)
关于NULL的事情我没有做对吗?更多信息
select count(*) from article AS a where for_interest is NOT NULL ;
count
-------
15
(1 row)
select count(*) from article ;
count
-------
15
(1 row)
Run Code Online (Sandbox Code Playgroud)
PostgreSQL版本是9.3.2.
添加样本数据,表格描述等(为此创建的新样本表只有2条记录)
test=# \d sample_article
Table "public.sample_article"
Column | Type | Modifiers
--------------+------------------------+-----------
id | integer |
title | character varying(150) |
for_interest …Run Code Online (Sandbox Code Playgroud) 在PostgreSQL表中,我有一个列有值的列
AX,B,C
A,BD
X,Y
J,K,L,M,N
Run Code Online (Sandbox Code Playgroud)
简而言之,每列记录的列中都会有一些逗号分隔的字符串.我想在每张唱片中得到最后一张.我最终得到了这个.
select id, reverse(substr(reverse(mycolumn),1,position(',' in reverse(mycolumn)))) from mytable order by id ;
Run Code Online (Sandbox Code Playgroud)
有没有更简单的方法?
我正在尝试将数据传递给 laravel 刀片并显示它。显然我错过了一些非常基本的东西。如果我使用 laravel format {{ $test_message }},它不会显示该值。如果我使用<?php echo $test_message ; ?>. 这是工作。来自我的控制器的代码 -
$data = ['message' => 'This is a test!'];
return view('test')->with([ 'test_message' => $data['message'] ]);
Run Code Online (Sandbox Code Playgroud)
看法
<html lang="en-US">
<head>
<meta charset="utf-8">
</head>
<body>
<p> <?php echo $test_message ; ?> </p>
<p> {{ $test_message }} </p>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
在输出中,我有“这是一个测试!” php 回显部分和 {{$test_message}} 下一行。