首页 \ 问答 \ mysql - 计数字母(mysql - count letters)

mysql - 计数字母(mysql - count letters)

谁能告诉我如何计算MySQL中字符串中的字母?

例如:

SELECT numberOfLetters('abc123 def')

将返回6

通过信件,我的意思是AZ和az。

numberOfLetters当然不是有效的SQL,但它说明了我想要做的事情。

我正在使用的MySQL版本是5.5.27


Can anyone tell me how to count the letters in a string in MySQL?

For example:

SELECT numberOfLetters('abc123 def')

would return 6

By letter, I mean A-Z and a-z.

numberOfLetters is not valid SQL of course, but it illustrates what I am trying to do.

The version of MySQL that I'm using is 5.5.27


原文:https://stackoverflow.com/questions/13467901
更新时间:2021-07-11 17:07

最满意答案

我不认为它是AS3还是AS2与它有关。

从Web浏览器的角度来看,它们都是一个黑盒子,上面写着“Flash Player插件”。 您一次只能安装一个版本的插件,因此即使您有AS2和AS3 swf,Web浏览器也会看到它有2个“Flash播放器插件版本10”的实例

将你想要做的事情归结为:

  1. 创建一个页面:
  2. 坚持使用swf
  3. 在页面中添加一个div并使用CSS定位将其“覆盖”在另一个swf上
  4. 坚持另一个瑞士法郎。

那么,这有用吗? - 是,非常好,但你必须在嵌入式flash对象上设置wmode="transparent" (感谢评论中的grapefrukt)。

我跑了一个测试:这是我的源代码:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <style type="text/css" media="screen">
            DIV{ width: 300px; height; 300px;}
            #background{ border: 1px solid green; background-color: green; z-index: 0; }
            #foreground{ border: 1px solid red; background-color: red; z-index: 50; }
        </style>
    </head>
    <body>
        <div id="background">
            <embed height="208" width="208" quality="high" bgcolor="#fff" src="bgswf.swf" type="application/x-shockwave-flash" wmode="transparent"/>
        </div>  

        <div id="foreground" style="position: absolute; left: 30px; top: 30px;">
            <embed height="208" width="208" quality="high" bgcolor="#fff" src="fgswf.swf" type="application/x-shockwave-flash" wmode="transparent"/>
        </div>  

    </body>
</html>

结果:

没有wmode=transparent ,在firefox和IE中是不一致的,并且很小。 有了它,你在IE和Firefox中的确应该做到了。
swf文件的行为(从布局的角度来看)就好像它们只是图像一样。 这个很酷。


I wouldn't think that whether it's AS3 or AS2 has anything to do with it.

From the point of view of the web browser, they are both a black box that says "Flash Player Plugin". You can only have one version of the plugin installed at one time, so even though you have an AS2 and an AS3 swf, the web browser just sees that it has 2 instances of "Flash player plugin version 10"

To boil it down what you seem to be trying to do is:

  1. Create a page:
  2. Stick a swf in it
  3. Add a div to the page and use CSS positioning to put it "over" the other swf
  4. Stick another swf in that div.

So, does this work? - No Yes, very well, but you must set wmode="transparent" on your embedded flash objects (thanks grapefrukt in comments).

I ran a test: here's my source code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <style type="text/css" media="screen">
            DIV{ width: 300px; height; 300px;}
            #background{ border: 1px solid green; background-color: green; z-index: 0; }
            #foreground{ border: 1px solid red; background-color: red; z-index: 50; }
        </style>
    </head>
    <body>
        <div id="background">
            <embed height="208" width="208" quality="high" bgcolor="#fff" src="bgswf.swf" type="application/x-shockwave-flash" wmode="transparent"/>
        </div>  

        <div id="foreground" style="position: absolute; left: 30px; top: 30px;">
            <embed height="208" width="208" quality="high" bgcolor="#fff" src="fgswf.swf" type="application/x-shockwave-flash" wmode="transparent"/>
        </div>  

    </body>
</html>

Results:

Without wmode=transparent, is inconsistent and minorly broken in firefox and IE. With it, does exactly what you think it should in both IE and firefox.
The swf files behave (from a layout point of view) as if they are just images. It's cool.

相关问答

更多

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)