Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. MySQL
  4. select problem!

select problem!

Scheduled Pinned Locked Moved MySQL
databasehelpquestion
2 Posts 2 Posters 41 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    miss YY
    wrote on last edited by
    #1

    Now ihave do this

    select a from table_a where aa=123

    select b from table_a where aa=32

    select sum(aa) as c from table_a where aa=44

    select sum(bb) as d from table_a where aa=88

    i want to select them just use one SQL.not use union,because i want to show them like this : a b c d 1 2 32 32 23 43 54 564 32 43 64 45 show four fields,not one,it's difficulty for me,i have done all day long,everyone who can teach me ?very apprciate!!

    A 1 Reply Last reply
    0
    • M miss YY

      Now ihave do this

      select a from table_a where aa=123

      select b from table_a where aa=32

      select sum(aa) as c from table_a where aa=44

      select sum(bb) as d from table_a where aa=88

      i want to select them just use one SQL.not use union,because i want to show them like this : a b c d 1 2 32 32 23 43 54 564 32 43 64 45 show four fields,not one,it's difficulty for me,i have done all day long,everyone who can teach me ?very apprciate!!

      A Offline
      A Offline
      April Fans
      wrote on last edited by
      #2

      select t1.a, t2.b, sum(t3.aa), sum(t4.bb) from table_a as t1,table_a as t2,table_a as t3,table_a as t4 where t1.aa=123,t2.aa=32,t3.aa=44 ,t4.aa=88

      April Comm100 - Leading Live Chat Software Provider

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups