SQL 92 statement

  • How do I convert the following T-SQL query to a SQL 92 statement

    select *

    from authors a, titles t, titleauthor ta

    where a.au_id *= ta.au_id

    and   t.title_id *= ta.title_id

     

     

  • The equivalent SQL 92 statement would be

    select * from (select *     from authors a,titles ta) z left outer join titleauthor ta on ta.title_id=z.title_id and ta.au_id=z.au_id

    If the statement changed slightly to

    select * from authors a, titles t, titleauthor tawhere a.au_id =* ta.au_idand   t.title_id =* ta.title_id

    The equivalent SQL 92 statement would be

    select a.*,t.*,ta.* from titleauthor ta left outer join authors a on a.au_id = ta.au_idleft outer join titles t on t.title_id = ta.title_id

    That's it!

    Thanx

  • inugroho is right on.  Your original query does not look useful, you probably wanted to put the * on other side of the equals sign? Then inugroho's second ansi-92 query is very clean, and useful. 

  • yeah thanx for the help

    i know the query won't be very helpful. it was just a prototype of some bigger queries.

    any wy i'll ty this out.

     

    thanx a lot

     

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply