SQL query multiple tables don't give a result

Discuss RoboTask here

SQL query multiple tables don't give a result

Postby meobeou » Tue Jan 15, 2019 10:13 am

Dear readers,

Strange a SQL-statement only returns values using one table?

Example:

CODE: SELECT ALL
Select
Code: Select all
  PUB."va-211".cdadmin,
  PUB."va-211".cdorder,
  PUB."va-211".cdprodukt,
  PUB."bb-040"."omschr-35",
  PUB."va-211".cdstatus,
  PUB."va-211".aantbest,
  PUB."va-211".aantgelev,
  PUB."va-211".aanttefact,
  PUB."va-211".aantgefact,
  PUB."va-210"."datum-order",
  PUB."va-210".cddeb,
  PUB."va-210"."datum-lna",
  PUB."va-210"."datum-lvoor"
From
  PUB."va-211" Inner Join
  PUB."bb-040"
    On PUB."va-211".cdprodukt = PUB."bb-040".cdprodukt Inner Join
  PUB."va-210"
    On PUB."va-211".cdorder = PUB."va-210".cdorder And PUB."va-211".cdadmin =
    PUB."va-210".cdadmin
Where
  PUB."va-211".cdadmin = '01' And
  PUB."va-211".cdstatus = 'O' And
  PUB."va-210".cddeb = '{test(0)}'



Returns no result

Code: Select all
CODE: SELECT ALL
Select
  PUB."va-210"."datum-order",
  PUB."va-210".cddeb,
  PUB."va-210"."datum-lna",
  PUB."va-210"."datum-lvoor"
From
  PUB."va-210"
Where
  PUB."va-210".cddeb = '{test(0)'



Returns a result

So it seems that multiple table queries don't give a result??

Is that right? Or somebody has teh solution?

Lee!
meobeou
 
Posts: 1
Joined: Tue Jan 15, 2019 10:02 am

Re: SQL query multiple tables don't give a result

Postby Oleg » Wed Jan 16, 2019 11:47 am

The problem is in your SQL query.
It's necessary to analyse structure of your database to solve the problem
Oleg Yershov
Oleg
Site Admin
 
Posts: 2398
Joined: Thu Jan 01, 1970 1:00 am


Return to General Discussion

Who is online

Users browsing this forum: Google [Bot] and 14 guests