Search Postgresql Archives

general questions about joins in queries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.
Is it better to use A) or B) ?
 
A)
 
SELECT
 "public"."departments".*,
 "public"."plants".*,
 "public"."batches_microbs".*,
 "public"."results_microbs".*
FROM
 "public"."departments",
 "public"."plants",
 "public"."batches_microbs",
 "public"."results_microbs"
WHERE
 "plants"."department" = "departments"."department" AND
 "batches_microbs"."plant" = "plants"."plant" AND
 "results_microbs"."batch" = "batches_microbs"."batch"
 
B)
 
SELECT
 "public"."departments".*,
 "public"."plants".*,
 "public"."batches_microbs".*,
 "public"."results_microbs".*
FROM

public.departments
  INNER JOIN public.plants ON (public.departments.department = public.plants.department)
  INNER JOIN public.batches_microbs ON (public.plants.plant = public.batches_microbs.plant)
  INNER JOIN public.results_microbs ON (public.batches_microbs.batch = public.results_microbs.batch)
 

Thanks,
 
Zlatko

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux