如何使用没有前缀的别名连接表

时间:2017-01-13 09:20:56

标签: php mysql database alias lumen

这是我的活动sql:

 C:\Users\apzal.bahin\Documents\Business Media\Learning\Cucumber calabash\Calabas
    hCucumberTest>gem install json -v 1.8.5
    Temporarily enhancing PATH to include DevKit...
    Building native extensions.  This could take a while...
    ERROR:  Error installing json:
            ERROR: Failed to build gem native extension.

        current directory: C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/json-1.8.5/ext/jso
    n/ext/generator
    C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20170113-12584-dvx97z.rb extconf.rb
    creating Makefile

    current directory: C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/json-1.8.5/ext/json/ex
    t/generator
    make "DESTDIR=" clean

    current directory: C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/json-1.8.5/ext/json/ex
    t/generator
    make "DESTDIR="
    generating generator-x64-mingw32.def
    compiling generator.c
    make: x86_64-w64-mingw32-gcc: Command not found
    make: *** [generator.o] Error 127

    make failed, exit code 2

    Gem files will remain installed in C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/json-1
    .8.5 for inspection.
    Results logged to C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0
    /json-1.8.5/gem_make.out

然后我需要在流明中使用DB 所以我这样写:

SELECT sag.goods_id, if(sa.status=3, 1, 0) AS act_status 
FROM d_seckill_activity_goods AS sag LEFT JOIN d_seckill_activity AS sa ON sa.id = sag.sa_id
WHERE sa.id = 1

幸运的是它运作良好,但我讨厌$ prefix变量,

是使用DB的另一种方式吗?

0 个答案:

没有答案