🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: bit.databases.mssql-l
Article #130

Re: Quick SQL problem

#130
From: Theo Peterbroers
Date: Thu, 21 Sep 2000 00:00
28 lines
1581 bytes
In article <b3ucssovn6enkufc8i3e30ai72s95ofpn4@4ax.com>, Dermegy! <dermegy@home.com> wrote:
>I am having a silly SQL problem. i know it is probably something
>overtly simple.
>
>
>how come I cant ad in WHERE subject_id <> 38 after FROM ...without an
>error ?
>
>i.e.
>SELECT sl_subjects.subject_id, sl_subjects.subject_name,
>sl_categories.category_name, sl_categories.category_id
>        FROM sl_subjects 
>        WHERE subject_id <> 38
>        INNER JOIN sl_categories ON sl_subjects.subject_id =
>sl_categories.subject_lnk
>        ORDER BY sl_subjects.subject_name, sl_categories.category_name
>
>Produces an output error.
>
>Code does work perfectly without the WHERE statement.
>
>Please advise by e-mail: dermegy@home.com
The WHERE condition literally breaks the JOIN.
If you do SELECT ...
          FROM subjects INNER JOIN categories ON ...
          WHERE sl_subjects.subject_id <> 38
          ORDER BY ...
the thing should work.
Technical Details
Message-ID: <8qd91b$kag$1@highway.leidenuniv.nl>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <b3ucssovn6enkufc8i3e30ai72s95ofpn4@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f6611,e6f732d7e0aa9578
X-Google-Attributes: gidf6611,public
From: peterbroers@rhbcml.leidenuniv.nl (Theo Peterbroers)
Subject: Re: Quick SQL problem
Date: 2000/09/21
Message-ID: <8qd91b$kag$1@highway.leidenuniv.nl>
X-Deja-AN: 672487090
References: <b3ucssovn6enkufc8i3e30ai72s95ofpn4@4ax.com>
X-Complaints-To: usenet@highway.leidenuniv.nl
X-Trace: highway.leidenuniv.nl 969549675 20816 132.229.92.115 (21 Sep 2000 15:21:15 GMT)
Organization: Stichting FLORON
NNTP-Posting-Date: 21 Sep 2000 15:21:15 GMT
Newsgroups: bit.databases.mssql-l