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
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Inner Query in mysql

Inner Query in mysql

Scheduled Pinned Locked Moved Database
databasemysqlquestion
7 Posts 5 Posters 0 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.
  • R Offline
    R Offline
    Rakesh Meel
    wrote on last edited by
    #1

    Is there any posibility of Inner Query in my SQL as Like MS Sql?

    S S D 3 Replies Last reply
    0
    • R Rakesh Meel

      Is there any posibility of Inner Query in my SQL as Like MS Sql?

      S Offline
      S Offline
      Simon Bang Terkildsen
      wrote on last edited by
      #2

      I'm actually not sure what Inner Query means, I'm guessing a subquery, if so then this should help http://dev.mysql.com/doc/refman/5.1/en/subqueries.html[^]

      1 Reply Last reply
      0
      • R Rakesh Meel

        Is there any posibility of Inner Query in my SQL as Like MS Sql?

        S Offline
        S Offline
        Simon_Whale
        wrote on last edited by
        #3

        You need to expand on your question so that we can answer it correctly and hopefully save you time. also have a read of this in case the other answer is not what you are looking for. MySQL Inner joins[^]

        Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch

        1 Reply Last reply
        0
        • R Rakesh Meel

          Is there any posibility of Inner Query in my SQL as Like MS Sql?

          D Offline
          D Offline
          DaveAuld
          wrote on last edited by
          #4

          Do you mean nested Selects? i.e.

          Select something From tableThis Where ID In (Select somethingelse From tableThat Where condition );

          if you do then; http://dev.mysql.com/doc/refman/5.0/en/subqueries.html[^]

          Dave Find Me On: Web|Facebook|Twitter|LinkedIn


          Folding Stats: Team CodeProject

          R 1 Reply Last reply
          0
          • D DaveAuld

            Do you mean nested Selects? i.e.

            Select something From tableThis Where ID In (Select somethingelse From tableThat Where condition );

            if you do then; http://dev.mysql.com/doc/refman/5.0/en/subqueries.html[^]

            Dave Find Me On: Web|Facebook|Twitter|LinkedIn


            Folding Stats: Team CodeProject

            R Offline
            R Offline
            Rakesh Meel
            wrote on last edited by
            #5

            Thanks for good comment dear... but this syntex not working proper now i m sending my sample query on message board. "SELECT * From tbladussentry where SID in (select Id from tbladusentry where SID in ( select ID from tbladuset where CID in(108,367)))"

            G 1 Reply Last reply
            0
            • R Rakesh Meel

              Thanks for good comment dear... but this syntex not working proper now i m sending my sample query on message board. "SELECT * From tbladussentry where SID in (select Id from tbladusentry where SID in ( select ID from tbladuset where CID in(108,367)))"

              G Offline
              G Offline
              GuyThiebaut
              wrote on last edited by
              #6

              I know you asked for subqueries however in this case I think joins are easier to read and more elegant:

              select t1.*
              From tbladussentry t1
              join tbladusentry t2
              on t1.SID = t2.Id
              join tbladuset t3
              on t2.SID = t3.ID
              and t3.CID in(108,367)

              Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
              R 1 Reply Last reply
              0
              • G GuyThiebaut

                I know you asked for subqueries however in this case I think joins are easier to read and more elegant:

                select t1.*
                From tbladussentry t1
                join tbladusentry t2
                on t1.SID = t2.Id
                join tbladuset t3
                on t2.SID = t3.ID
                and t3.CID in(108,367)

                Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
                R Offline
                R Offline
                Rakesh Meel
                wrote on last edited by
                #7

                Thanks dear....You are probably right but there is something more.......Look at my Example proper and told that is possible or not in MySql

                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