小编use*_*267的帖子

2个bigquery时间戳字段之间的分钟差异

如何在google bigquery中的两个时间戳字段之间获得分钟差异?我所知道的唯一功能是Datediff,它在一天中给出了差异

谢谢

google-bigquery

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

如何在ColdFusion中使用MongoDB

我正在使用MongoDB 3.2.3和mongo-java-driver-3.2.2.jar库.

为了连接到服务器然后连接到特定数据库,我执行了以下操作.然后我创建一个名为的集合col1:

<cfset Mongo  = CreateObject("java","com.mongodb.MongoClient")>
<cfset Mongo.init("192.168.0.30")>
<cfset db = Mongo.getDatabase('testaj')>
<cfset db.createCollection("col1") >
Run Code Online (Sandbox Code Playgroud)

我从互联网上获得了以下代码,以便将文档插入到集合中:

<cffunction name="m" returntype="any">
    <cfargument name="value" type="any">
    <cfif IsJSON(arguments.value)>
        <cfset local.retrun = CreateObject("java","com.mongodb.util.JSON").parse(arguments.value)>
    <cfelse>
        <cfset local.retrun = CreateObject("java","com.mongodb.util.JSON").parse( SerializeJSON(arguments.value) )>     
    </cfif>
    <cfreturn local.retrun>
</cffunction>

<cfset doc = {
    "Name"  = "Marc",
    "Spouse"= "Heather",
    "Fruit" = "Mango",
    "Kids"  = [
                {"Name"="Alexis", "Age"=7, "Hair"="blonde", "Description"="crazy" },
                {"Name"="Sidney", "Age"=2, "Hair"="dirty blonde", "Description"="ornery" }
            ],
    "Bike" = "Felt",
    "LoveSQL" = true,
    "TS" = now(),
    "Counter" = …
Run Code Online (Sandbox Code Playgroud)

java coldfusion mongodb

10
推荐指数
1
解决办法
1352
查看次数

数据库处于恢复状态

我厌倦了恢复我的数据库,但我发现我正在恢复一个错误的数据库,所以我立即终止了该进程。不幸的是,数据库处于恢复状态,无法再访问。

谁能帮我恢复正常状态?

提前致谢

sql t-sql database sql-server restore

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

在 bigquery 中交叉应用等效的 MSSQL 运算符

Sql 服务器语法或 bigquery 语法中是否存在与交叉应用等效的内容。

我需要在没有交叉应用的情况下编写此查询:

   select *
    from t1 
    cross apply (select top 1 col1,col2,col3
    from t2
    where col1 = t1.col1
    and (col2 = '0' or col2 = t1.col2)
and (col3 = '0' or (col3 = left(t1.col3)  and t1.col4 = 'fr'))
    order by col2 desc, col3 desc)
Run Code Online (Sandbox Code Playgroud)

名为“Delivery”的 t1 包含交货信息:

Delivery_ID,Delivery_ShipmentDate,Country_Code,address_ZipCode and the providerservice_id
Run Code Online (Sandbox Code Playgroud)

名为“ProviderService”的 t2 包含有关提供者服务的信息:

Providerservice_id,DCountry_ID , DZone_Code  as well as a numeric ProviderService_DeliveryTime.
Run Code Online (Sandbox Code Playgroud)

因此,每个 Delivery_ID 都有一个 ProviderService_ID 并且对于同一个 Providerservice,我们可以根据此表中的其他列(DCountry_ID 、 DZone_Code)有几个不同的 ProviderService_DeliveryTime

所以最终的查询将是:

    Select t1.Delivery_ShipmentDate,t2.ProviderService_DeliveryTime
    from Delivery …
Run Code Online (Sandbox Code Playgroud)

sql-server google-bigquery

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