如何在SQL中仅显示VARCHAR的一部分

时间:2015-10-02 12:37:09

标签: mysql sql database varchar

我的查询返回数据库中用户的电子邮件地址列表。但是,我只希望它显示提供者,而不是显示完整的电子邮件地址。例如hotmail.com gmail.com等我需要添加什么? 编辑:我正在使用MYSQL Workbench

1 个答案:

答案 0 :(得分:3)

类似的东西:

server {
        listen   80; ## listen for ipv4; this line is default and implied

        root /var/www/vhosts/community;

        index index.php app.php;

        # Make site accessible from http://localhost/
        server_name mywebsite.com/community;


        error_log /var/log/nginx/community.error.log;

        ## Compression
        gzip              on;
        gzip_buffers      16 8k;
        gzip_comp_level   4;
        gzip_http_version 1.0;
        gzip_min_length   1280;
        gzip_types        text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript ima$
        gzip_vary         on;

location / {     # protection from known vulnerability
    add_header 'Access-Control-Allow-Origin' '*';
    add_header 'Access-Control-Allow-Credentials' 'true';
    add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE';try_files $uri $uri/ @venice;
  }

  location @venice {
        add_header 'Access-Control-Allow-Origin' '*';
        add_header 'Access-Control-Allow-Credentials' 'true';
        add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE';
        rewrite ^/community(.+)$ /index.php?$args last;
  }




        # Allow access to root index.php
#        location ~ ^/index\.php {
        location ~ \.php {
                include     fastcgi_params;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass    127.0.0.1:9000;
                fastcgi_index   index.php;
                fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
        }

        location ~* \.(jpg|jpeg|gif|css|png|js|ico|html|pdf|xlsx|xls|docx|doc|zip|rar)$ {
                 access_log off;        }

        #
        # 404 error page
        #
        error_page 404 /404.html;

        #
        # redirect server error pages to the static page /50x.html
        #
        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
               root /usr/share/nginx/www;
        }

        location ~ /\.ht {
                deny all;
        }
}

由ANSI / ISO SQL定义:

substring(email from position('@' in email) + 1)

由Mimer SQL支持。