Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update with lag
Message
De
29/03/2019 10:50:24
 
 
À
29/03/2019 03:28:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
01667668
Message ID:
01667700
Vues:
44
It's telling you that the statement

SELECT DATEDIFF(second,LAG(Date,1) OVER(ORDER BY Date),Date)

is returning multiple values. Make sure that that this statement is only returning one value for each record in bin_final.


>Dear Sir,
>
>I have these codes
>
>
>  SELECT id,Date,sno,bin,batch,DATEDIFF(second,LAG(Date,1) OVER(ORDER BY Date),Date) AS alias
>   FROM bin1_final
>
>
>the above codes work fine, no issue.
>
>Now I want to update column with above codes like this
>
>
> update bin1_final set gap_int=(
>     SELECT DATEDIFF(second,LAG(Date,1) OVER(ORDER BY Date),Date) as ddif
>   FROM bin1_final)
>
>
>But it says:
>
>Msg 512, Level 16, State 1, Line 1
>Subquery returned more than 1 value. This is not permitted when the subquery follows ............ or' when the subquery is used as an expression.
>The statement has been terminated.
>
>Please help
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform