loop  报错

英 [luːp]  美 [lup]  口语练习
  • vi. 打环;翻筋斗
  • n. 环;圈;弯曲部分;翻筋斗
  • vt. 使成环;以环连结;使翻筋斗

syntax  报错

英 ['sɪntæks]  美 ['sɪntæks]  口语练习 跟读
  • n. 语法;句法;有秩序的排列
1
@Macho more info needed – true May 20 '11 at 7:56
8
SQL is a very different language compared to what you're used to. It's focused on what, not how. You tell SQL Server what results you want, and let it figure out how to produce the answer. Or, to repharse what I've just said - there isn't a for loop in SQL. – Damien_The_Unbeliever May 20 '11 at 7:58
3
WHILE @I < 10; SET @I = @I + 1; BEGIN; ...; END? However, this should not be used for most query processing (but is sometimes required for imperative manipulation). Many such instructions/hints are available on google using the search "tsql for loop". – user166390 May 20 '11 at 7:58
5
Avoid loops in favour of JOINs and set operations. – Oded♦ May 20 '11 at 7:59
2
If you are not expert in SQL, you should not be considering using a loop. There are only a few conditions where one is needed and most of the rest of the time, using a loop is the equivalent of pushing your car instead of driving it. Learn to think in terms of data sets instead of looping through records. LOoping is an expert level function not because the syntax is hard but because you need to know exactly how much harm you can do with it before you should be allowed to use it. – HLGEM Aug 14 '13 at 21:06

  

What is the syntax for a for loop in TSQL?的更多相关文章

  1. linux shell 报错 Syntax error: Bad for loop variable

    在linux下写了一个简单的shell,循环10次. test.sh #!/bin/bash ## ##循环10次 ## ; i<; i++)); do echo Good Morning ,t ...

  2. linux shell scripts:Syntax error: Bad for loop variable

    执行脚本报错 #!/bin/bash s=0 for (( i=1; i<=100; i++ )) do s=$(( $s + $i )) done echo $s sh add.sh 报错: ...

  3. shell脚本:Syntax error: Bad for loop variable错误解决方法(转)

    Linux Mint中写了一个简单的shell脚本,利用for..do..done结构计算1+2+3......+100的值,结果执行"sh -n xxx.sh"检测语法时总是报错 ...

  4. Syntax error: Bad for loop variable解决办法

    从 ubuntu 6.10 开始,ubuntu 就将先前默认的bash shell 更换成了dash shell:其表现为 /bin/sh 链接倒了/bin/dash而不是传统的/bin/bash. ...

  5. (转)Syntax error:

    但是运行时总是报下面这个错,如下: test11-loop.sh: 5: Syntax error: Bad for loop variable 几经查找语法,没有问题,后来在网上找到问题原因: 代码 ...

  6. Mysql控制语句

    14.6.5.1 CASE Syntax 14.6.5.2 IF Syntax 14.6.5.3 ITERATE Syntax 14.6.5.4 LEAVE Syntax 14.6.5.5 LOOP ...

  7. OpenMP for Fortran

    OpenMP for Fortran OpenMP Directive Syntax of OpenMP compiler directive for Fortran: !$OMP Directive ...

  8. ABAP-语法检查

    1.界面 2.代码 *&---------------------------------------------------------------------* *& Report ...

  9. ubuntu 下执行定时任务

    Window shell文件在linux系统下执行不了的解决办法 一些人喜欢用vim来写linux shell script, 但是, 有的人喜欢在Windows下用一些方便的编辑器(比如鼎鼎大名的N ...

随机推荐

  1. 简单使用Moq框架

    Moq框架简单使用   系列目录 Moq库简介及安装 Moq简介 Moq是.net平台下的一个非常流行的模拟库,只要有一个接口它就可以动态生成一个对象,底层使用的是Castle的动态代理功能. 它的流 ...

  2. C# 拷贝文件夹到指定文件夹并更改文件夹名称

    using System; using System.Collections.Generic; using System.Text; namespace ClientPrintServer.Tools ...

  3. 构建C1000K的服务器(1) – 基础

    转自: http://www.ideawu.net/blog/archives/740.html 著名的 C10K 问题提出的时候, 正是 2001 年, 到如今 12 年后的 2013 年, C10 ...

  4. jQuery中$(this)与this的区别

    经常在写jQuery的时候分不清this 和 $(this),为了方便起见尽量不用this,只用$(this).但是今天在别人的代码的基础上改一些东西,又遇到了这个this,不得不把它弄明白. $(t ...

  5. IDEA界面太丑??尝试一下这几个风格

    >>>>>>>>>>原文地址<<<<<<<<<< >>>> ...

  6. C_局部变量&全局变量

    2018-5-9   Writen By Stephen.Yu  一.定义 1. 局部变量:在函数中定义的变量 2. 全局变量:在所有函数体之外定义 定义(Definition):声明并分配内存;未分 ...

  7. C语言学习笔记01——C语言概述

    作者:Eventi 出处:http://www.cnblogs.com/Eventi 欢迎转载,也请保留这段声明.谢谢! 1 C语言的起源 1972年,贝尔实验室的丹尼斯·里奇(Dennis Ritc ...

  8. Gin上传文件到MongoDB gridfs

    目录 上传图片 下载图片 上传图片 func imagePost(c *gin.Context) { image, err := c.FormFile("file") if err ...

  9. golang 之 sql

    golang提供了sql包查询数据 建立连接 导入第三方包 import( "database/sql" _"github.com/go-sql-driver/mysql ...

  10. Scala 系列(四)—— 数组 Array

    一.定长数组 在 Scala 中,如果你需要一个长度不变的数组,可以使用 Array.但需要注意以下两点: 在 Scala 中使用 (index) 而不是 [index] 来访问数组中的元素,因为访问 ...