Subquery

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Balaji. M.

    #1

    Subquery

    I have the following table structures;

    create table Platform (
    PlatformId mediumint Primary Key auto_increment,
    PlatformName varchar(25),
    ProjectName varchar(50)
    );

    create table PlatformSubType (
    PlatformSubType Id mediumint Primary Key auto_increment,
    PlatformId mediumint,
    PlatformSubType Name varchar(50)
    );

    When I query this way, its giving error as follows
    select * from PlatformSubType where PlatformId IN
    (select PlatformId from Platform where PlatformName="c 1200" and ProjectName ="Fluorine") ;

    You have an error in your SQL syntax near 'select Platform.Platfo rmId from Platform where PlatformName="c 1200" and ProjectN' at line 2


    Thanks in Advance.
  • Aggro

    #2
    Re: Subquery

    Balaji. M. wrote:
    [color=blue]
    > I have the following table structures;
    > create table Platform ( PlatformId mediumint Primary Key auto_increment,
    > PlatformName varchar(25), ProjectName varchar(50) );
    > create table PlatformSubType ( PlatformSubType Id mediumint Primary Key
    > auto_increment, PlatformId mediumint, PlatformSubType Name varchar(50) );
    > When I query this way, its giving error as follows select * from
    > PlatformSubType where PlatformId IN (select PlatformId from Platform
    > where PlatformName="c 1200" and ProjectName ="Fluorine") ;
    > You have an error in your SQL syntax near 'select Platform.Platfo rmId
    > from Platform where PlatformName="c 1200" and ProjectN' at line 2[/color]

    Subqueries are supported from version 4.1, what version are you using?

    Comment

    Working...