pegaga1979
6th February 2014, 10:01
Hi Experts,

im creating a new query at SQL Query session.
I used 4 tables in my query.
However, i can't print out data from 4th table which is tipcf060.dsca
Require your expertise to help me.
my text manager as below:

select
hcasc905.kenn, | Kenn ID
hcasc905.chkp, | CheckPoint
hcasc905.seqn, | Sequence Number
hcasc905.rcdt, | CheckPoint Date
hccom902.serl, | VIN Number
hccom902.vcls, | Vehicle Class
hcsls901.bopt, | Body Color Option
tipcf060.dsca | Description
from
hcasc905, | Received CheckPoint Messages
hccom902, | KENN Number
hcsls901, | Vehicle Order Data
tipcf060 | Product Feature Options
where
hcasc905.kenn >= hcasc905.kenn.f and
hcasc905.kenn <= hcasc905.kenn.t and
hcasc905.chkp >= hcasc905.chkp.f and
hcasc905.chkp <= hcasc905.chkp.t and
hcasc905.rcdt >= hcasc905.rcdt.f and
hcasc905.rcdt <= hcasc905.rcdt.t and
hcasc905.kenn = hcsls901.kenr and
hcasc905.kenn = hccom902.kenn and
hcsls901.bopt = tipcf060.copt and
tipcf060.copt = hcsls901.bopt


Tq.

pegaga1979
6th February 2014, 12:53
Hi,

I tried new code but it result print repeated line 4 times.
New code as below:
select
hcsls901.kenr, | Kenn Number
hcsls901.vkls, | INFAS Vehicle Class
hcsls901.bopt, | Body Color Option
hccom902.serl, | VIN Number
tipcf060.dsca, | Description
hcasc905.chkp, | CheckPoint
hcasc905.rcdt, | CheckPoint Date
hcasc905.seqn | Sequence Number

from
hcasc905, | Received CheckPoint Messages
hccom902, | KENN Number
hcsls901, | Vehicle Order Data
tipcf060 | Product Feature Options

where
hcsls901.kenr >= hcsls901.kenr.f and
hcsls901.kenr <= hcsls901.kenr.t and
hcsls901.bopt = tipcf060.copt and
hcsls901.kenr = hccom902.kenn and
hcsls901.kenr = hcasc905.kenn

------------------------------------------------------------------------------------------------------------------------------------------------------------------
Kenn Number | dsp901.vkl | hccom902.bopt | Description | VIN Number | CheckPoint | CheckPoint Date | hcacp903.s
------------------+------------+-----------------+--------------------------------+-------------------+------------+------------------------+------------------------
KV192013362812521 | 36 | 8EM | Reflex Silver | PPVZZZ3CZEL000609 | M100 | 09-11-2013 00:00 | 2173
KV192013362812521 | 36 | 8EM | Reflex Silver | PPVZZZ3CZEL000609 | M100 | 09-11-2013 00:00 | 2173
KV192013362812521 | 36 | 8EM | Reflex Silver | PPVZZZ3CZEL000609 | M100 | 09-11-2013 00:00 | 2173
KV192013362812521 | 36 | 8EM | Reflex Silver | PPVZZZ3CZEL000609 | M100 | 09-11-2013 00:00 | 2173
KV192013362812522 | 36 | 7SM | Lt.Brown Metallic | PPVZZZ3CZEL000610 | M100 | 09-11-2013 00:00 | 2174
KV192013362812522 | 36 | 7SM | Lt.Brown Metallic | PPVZZZ3CZEL000610 | M100 | 09-11-2013 00:00 | 2174
KV192013362812522 | 36 | 7SM | Lt.Brown Metallic | PPVZZZ3CZEL000610 | M100 | 09-11-2013 00:00 | 2174
KV192013362812522 | 36 | 7SM | Lt.Brown Metallic | PPVZZZ3CZEL000610 | M100 | 09-11-2013 00:00 | 2174

JaapJD
6th February 2014, 13:46
I think tipcf060.copt is not unique. It can be available in multiple product features.

bhushanchanda
6th February 2014, 15:42
Also explore the functionality of refers to clause in select statement. Write your query for 2 tables first and then move further. That way you will figure out the exact issues.