subquery!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • artistlikeu
    New Member
    • Nov 2006
    • 38

    #1

    subquery!

    dear all

    is it possible to write a subquery in inside the main query in python program....
    for example something like this.....

    courses = db.query("selec t course_id, student_id, select course_coordina tor from teachers join course on teacher.course_ id=course.cours e_id, start_date from school)"

    QUERy .....student_id , select course_coordina tor from teachers join course on teacher.course_ id=course.cours e_id..... is giving one info for main query and it is required.......

    will this query work..... if not any suggestion to write subquery.....
    thnx
  • Motoma
    Recognized Expert Specialist
    • Jan 2007
    • 3236

    #2
    Originally posted by artistlikeu
    dear all

    is it possible to write a subquery in inside the main query in python program....
    for example something like this.....

    courses = db.query("selec t course_id, student_id, select course_coordina tor from teachers join course on teacher.course_ id=course.cours e_id, start_date from school)"

    QUERy .....student_id , select course_coordina tor from teachers join course on teacher.course_ id=course.cours e_id..... is giving one info for main query and it is required.......

    will this query work..... if not any suggestion to write subquery.....
    thnx

    I am assuming you are using MySQLdb.
    If your version of supports subqueries (i.e. you can run the query from the Query Browser or command line) then yes, this is perfectly fine.
    The easiest way, I would say, is just to test it using IDLE.

    Comment

    • bartonc
      Recognized Expert Expert
      • Sep 2006
      • 6478

      #3
      There is a PostgreSQL Forum and several other DB forums on TSDN. One of those may be a better place to ask query questions.

      Comment

      • artistlikeu
        New Member
        • Nov 2006
        • 38

        #4
        Originally posted by bartonc
        There is a PostgreSQL Forum and several other DB forums on TSDN. One of those may be a better place to ask query questions.
        thnx dear Bartonc..... i put there also....... BUt i put some question there.... if u kindly have look..... sorry to bother u....
        cheers

        Comment

        Working...