首页 \ 问答 \ 在SQL Server 2000中按字段按字母顺序排序(Order by Field in non-alphabetical order in SQL Server 2000)

在SQL Server 2000中按字段按字母顺序排序(Order by Field in non-alphabetical order in SQL Server 2000)

我试图按不按字母顺序排列的名称列表排序项目。 完成清单后,我试图按照字母顺序继续其余部分,而不是最初选择的部分。

看例子:

INPUT:

print 'Results:'  
select * from Geniuses
    order by ('Charles Babbage', 
              'Albert Einstein', 
              'Adrien-Marie Legendre', 
              'Niels Henrik Abel')  

然后按字母顺序排序

OUTPUT:

Results:
Charles Babbage ... details
Albert Einstein ...
Adrien-Marie Legendre ...
Niels Henrik Abel ...
Arthur Cayley ...
...

I'm trying to order items by a list of names that are not in alphabetical order. After completing the list I am trying to continue the rest in alphabetical order without the ones I initially selected.

See example:

INPUT:

print 'Results:'  
select * from Geniuses
    order by ('Charles Babbage', 
              'Albert Einstein', 
              'Adrien-Marie Legendre', 
              'Niels Henrik Abel')  

then finally sort the rest in alphabetical order...

OUTPUT:

Results:
Charles Babbage ... details
Albert Einstein ...
Adrien-Marie Legendre ...
Niels Henrik Abel ...
Arthur Cayley ...
...

原文:https://stackoverflow.com/questions/9132709
更新时间:2023-06-04 07:06

最满意答案

您的应用程序卡住了。 解决这个问题的方法是设置一个读取超时,正如这个问题所讨论的那样。 如果发生超时,则会抛出SocketTimeoutException。


Your application is stuck. The solution to that is to set a read timeout, as discussed in this question. If the timeout occurs a SocketTimeoutException will be thrown.

相关问答

更多
  • 如果所有您想要做的都是多次读取相同的信息,并且输入数据足够小以适应内存,则可以将数据从InputStream复制到ByteArrayOutputStream 。 然后,您可以获取相关的字节数组,并根据需要打开多个“克隆” ByteArrayInputStream 。 ByteArrayOutputStream baos = new ByteArrayOutputStream(); // Fake code simulating the copy // You can generally do better ...
  • 它们代表有些不同的东西。 InputStream是所有可能的字节流的祖先类,它本身不是有用的,但所有的子类(如使用的FileInputStream )都是处理二进制数据的好方法。 在对应的对象中, InputStreamReader (及其父类Reader )专门用于处理字符(如字符串),因此可以优雅地处理字符集编码(utf8,iso-8859-1等)。 简单的答案是:如果你需要二进制数据,你可以使用InputStream (也可以像DataInputStream ),如果你需要使用InputStreamR ...
  • 就在JDK里! 引用SequenceInputStream JavaDoc : SequenceInputStream表示其他输入流的逻辑级联。 它从一个有序的输入流集合开始,从第一个到第一个文件的读取到达文件结束,然后从第二个文件读取,依此类推,直到最后一个输入流到达文件的末尾。 你想连接任意数量的InputStream而SequenceInputStream只接受两个。 但是由于SequenceInputStream也是一个InputStream您可以递归应用它(嵌套): new SequenceInp ...
  • 我建议不。 从互联网收到的信息以包裹形式出现,包裹的顺序和速度会有所不同。 BufferedInputStream会自动管理它们,而InputStream可能会导致问题。 感谢您在论坛中发帖! I suggest no. The info received from the internet comes in packages and the sequence and speed of the packages coming will vary. BufferedInputStream automatica ...
  • 使用适合的URL(包括协议!)的java.net.URL#openStream() )。 例如 InputStream input = new URL("http://www.somewebsite.com/a.txt").openStream(); // ... 也可以看看: 使用java.net.URLConnection来触发和处理HTTP请求 Use java.net.URL#openStream() with a proper URL (including the protocol!). E.g ...
  • 如Roland所述, BufferedInputStream和DataInputStream.readFully()取代了所有的循环代码。 BufferedInputStream, as noted by Roland, and DataInputStream.readFully(), which replaces all the looping code.
  • 您的应用程序卡住了。 解决这个问题的方法是设置一个读取超时,正如这个问题所讨论的那样。 如果发生超时,则会抛出SocketTimeoutException。 Your application is stuck. The solution to that is to set a read timeout, as discussed in this question. If the timeout occurs a SocketTimeoutException will be thrown.
  • 正如Boris Spider已经评论过的那样,可以将整个流读取到字节数组流,然后在该资源上打开新流: byte[] byteArray = IOUtils.toByteArray(stream); InputStream input1 = new ByteArrayInputStream(byteArray); InputStream input2 = new ByteArrayInputStream(byteArray); Object body; tr ...
  • 正如错误所示,您正在主线程上进行网络调用。 在android中,你应该在后台线程中进行任何此类调用。 提示:scheck asyncTasks As the error suggests, you are doing networking calls on the main thread. In android, you should do any such calls in a background thread. Hint: scheck asyncTasks
  • 除非您从头到尾读取它并计算您自己读取的字节数,否则无法获得InputStream的长度。 您可以获得S3Object的长度: public static InputStream getResourceAsStream(String fileKey) { AmazonS3 s3Client = new AmazonS3Client(new ProfileCredentialsProvider()); S3Object obj = s3Client.getObject(new GetObject ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。