Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- Select



  How MySQL optmizes ORDER BY

In some situations, MySQL will just use an index to fulfill the requirement of an ORDER BY or GROUP BY statement without extra sorting. Although ORDER BY will not have the exact match with index, index can still be used as long as the portion that is not included in the index is included in the where clause. The following queries will all use index to process the ORDER BY or GROUP BY part: SELECT * FROM t1 ORDER BY key_part1,key_part2,... ;SELECT * FROM t1 WHERE key_part1=constant ORDER BY key_p...

   MySQL,index,ORDER BY,optimization     2012-11-13 11:01:05

  Select top 3 values from each group in a table with SQL

Yesterday, my friend Liu Bing asked me a question about how to select top 3 values for each person in a database table using SQL. I think this question is interesting and it deserves some thoughts. Here I record down how to solve this issue. Assume we have a table which has two columns, one column contains the names of some people and the other column contains some values related to each person. One person can have more than one value. Each value has a numeric type. The question is we want to se...

   SQL,Correlated query,top 3     2013-05-23 03:21:25

  What can select do in GoLang

In Go language, select is a keyword used to listen to and perform IO operations related to channels. With the select statement, we can simultaneously listen to multiple channels and perform corresponding operations when any of the channels are ready. This article will summarize the common uses of the select statement and provide some considerations when using it. Basic syntax The basic syntax of the select statement is as follows: select { case <-channel1: // when channel1 has data to ...

   GOLANG,SELECT,USAGE,SYNTAX,TUTORIAL     2023-08-12 20:17:02

  Cron Job in cPanel with PHP

Running PHP scripts automatically can have some big benefits. You can wait to have things get done when there is less traffic on your server, or you can ensure daily tasks get done on time. cPanel Simple CronEven if you do not know anything about cron jobs, and have never run a cron job before - you can get started with the simple cron tool built into cPanel. The url for it is: https://www.yoursite.com:2083/frontend/x/cron/simplecron.html? A few things you'll need is the path to php and the path...

   PHP,Cron,Autonomous Job,cPanel,Linux     2011-04-26 09:48:40

  Inline IF and CASE statements in MySQL

There are times where running IF statements inside a query can be useful. MySQL provides a simple way to do this through the use of IF and CASE statements. The IF statement takes three arguments; the conditional, the true value and the false value. False and true values may be static values or column values. For example: SELECT IF(score > 100, 100, score) AS score FROM exam_results this will return the value in the score column limited to a maximum value of 100. IF statements can a...

   MySQK,IF,Condition,CASE,SQL     2012-04-22 10:37:01

  Shortcut keys in Sublime Text 3(Animated demo)

Sublime Text 3 is a light weight code editor which supports lots of languages. It has lots of shortcuts and plugins easing work of programmers. In this post, we will introduce some shortcuts supported in Sublime Text 3 and show how powerful they are. 1. Select sibling matching(equal) word (Ctrl + D) Put the cursor on one word, press Ctrl + D to select the word, then press Ctrl and following by pressing D, it will select next matching word. The number of Ds pressed will mean number of matching wo...

   TIPS,SHORTCUT KEY,SUBLIME TEXT     2016-04-28 02:41:28

  Macro to change text color conditionally in Excel

Macros are small but very powerful VBA programs in Microsoft Office software. They can help us complete some repeated tasks automatically. Today, I will show you one macro example which is to change the text color conditionally. The excel file has a work sheet which contains some records of request. I want to check the status of each request, if the status of a request is approved, the text color of the status should be green; if the status of a request is rejected, the text color of the status ...

   Macro,Excel,Text color,Conditionally     2012-07-07 12:53:28

  What can CSS :has pseudo class be used for?

CSS's :has is a pseudo-class representing an element if any of the selectors passed as parameters matching at least one element. From the name, it's also easy to understand how it matches elements. The syntax is pretty easy as well: :has([some-selector]) With this pseudo class, it can do lots of things which previously would be challenging or need tweaking the DOM elements with JavaScript. This post will demonstrate what :has can be used for. Introduction Below are a few simple ex...

   CSS,:HAS,:NOT,PSEUDO CLASS     2022-09-18 01:40:54

  SQL Grammar Summary

整理了一下,希望对大家有用SQL语句大全  --语 句 功 能--数据操作SELECT --从数据库表中检索数据行和列INSERT --向数据库表添加新数据行DELETE --从数据库表中删除数据行UPDATE --更新数据库表中的æ...

   SQL,Query,Summary,Select,Update,Delete,I     2011-05-20 12:04:55

  How to Convert Images on Mac Finder

If you have a lot of images in different formats and you want to convert them to a common format, you can use the Mac Finder to do it easily and quickly. Here are the steps to follow: 1. Open the Finder and navigate to the folder where your images are stored. 2. Select the images that you want to convert. You can use the Shift key or the Command key to select multiple images at once. 3. Right-click on the selected images and choose Services > Preview from the context menu. This will open the ...

   MACOS,FINDER,IMAGE CONVERSION     2023-04-16 02:09:54