Please help with SQL Statement problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gary Bouchard

    #1

    Please help with SQL Statement problem

    MYSQL Version 4.0.15

    Can some anyone tell me what is wrong with the following statement;

    select bookings.key1,b ookings.surname ,bookings.first name,bookings.b ookingseqno,boo kings.filetype
    from bookings where (bookings.surna me='sanderson')
    and bookings.bookin gseqno IN(select bookingseqno from
    bookingcharacte ristics where chartype=2 and
    (bookingcharact eristics.charva lue = 2))
    order by bookings.key1, bookings.bookin gseqno

    I keep getting a syntax error on this statement, but it works with
    MSSQL server.

    It is saying I have a syntax error and showing this tidbit in the
    error message box; Syntax error near 'select bookingseqno from
    bookingcharacte ristics where chartype'

    Any help would be appreciated.
  • Aggro

    #2
    Re: Please help with SQL Statement problem

    Gary Bouchard wrote:
    [color=blue]
    > MYSQL Version 4.0.15
    >
    > Can some anyone tell me what is wrong with the following statement;
    >
    > select bookings.key1,b ookings.surname ,bookings.first name,bookings.b ookingseqno,boo kings.filetype
    > from bookings where (bookings.surna me='sanderson')
    > and bookings.bookin gseqno IN(select bookingseqno from
    > bookingcharacte ristics where chartype=2 and
    > (bookingcharact eristics.charva lue = 2))
    > order by bookings.key1, bookings.bookin gseqno[/color]

    You are using subqueries, which are supported from version 4.1. So
    upgrade your server, or use a workaround.

    http://www.mysql.com/doc/en/ANSI_diff_Subqueries.html

    Comment

    • Aggro

      #3
      Re: Please help with SQL Statement problem

      Gary Bouchard wrote:
      [color=blue]
      > MYSQL Version 4.0.15
      >
      > Can some anyone tell me what is wrong with the following statement;
      >
      > select bookings.key1,b ookings.surname ,bookings.first name,bookings.b ookingseqno,boo kings.filetype
      > from bookings where (bookings.surna me='sanderson')
      > and bookings.bookin gseqno IN(select bookingseqno from
      > bookingcharacte ristics where chartype=2 and
      > (bookingcharact eristics.charva lue = 2))
      > order by bookings.key1, bookings.bookin gseqno[/color]

      You are using subqueries, which are supported from version 4.1. So
      upgrade your server, or use a workaround.

      http://www.mysql.com/doc/en/ANSI_diff_Subqueries.html

      Comment

      Working...