Hi,
I've two tables, priv and bedr.
I need to find all values for parameter 'x' in fields priv.priv_name, bedr.bedr_name, bedr.bez_name, bedr.verv_name in one query. The table priv contains a foreign key (priv_x_bedr_id) to bedr.bedr_id.
SELECT * FROM priv, bedr WHERE priv.priv_name LIKE '%#x#' OR bedr.bedr_name LIKE '%#x#' OR bedr.bez_name LIKE '%#x#' OR bedr.verv_name LIKE '%#x#'
doesn't do the job. (The parameter reference is the right way in ColdFusion which I'm using)
Step 2 would be to LEFT JOIN tables priv and bedr ON tables cities and countries, f.i.
SELECT * FROM ((priv LEFT JOIN cities ON priv.priv_x_cit_id = cities.cit_id)
LEFT JOIN countries ON priv.priv_x_count_id = countries.count_id),
((bedr LEFT JOIN cities ON bedr.bedr_x_id = cities.cit_id)
LEFT JOIN countries ON bedr.bedr_x_count_id = countries.count_id)
WHERE "as in first query"
If somebody could help me out on this one, my job's at stake here![[sadeyes] [sadeyes] [sadeyes]](/data/assets/smilies/sadeyes.gif)
I've two tables, priv and bedr.
I need to find all values for parameter 'x' in fields priv.priv_name, bedr.bedr_name, bedr.bez_name, bedr.verv_name in one query. The table priv contains a foreign key (priv_x_bedr_id) to bedr.bedr_id.
SELECT * FROM priv, bedr WHERE priv.priv_name LIKE '%#x#' OR bedr.bedr_name LIKE '%#x#' OR bedr.bez_name LIKE '%#x#' OR bedr.verv_name LIKE '%#x#'
doesn't do the job. (The parameter reference is the right way in ColdFusion which I'm using)
Step 2 would be to LEFT JOIN tables priv and bedr ON tables cities and countries, f.i.
SELECT * FROM ((priv LEFT JOIN cities ON priv.priv_x_cit_id = cities.cit_id)
LEFT JOIN countries ON priv.priv_x_count_id = countries.count_id),
((bedr LEFT JOIN cities ON bedr.bedr_x_id = cities.cit_id)
LEFT JOIN countries ON bedr.bedr_x_count_id = countries.count_id)
WHERE "as in first query"
If somebody could help me out on this one, my job's at stake here
![[sadeyes] [sadeyes] [sadeyes]](/data/assets/smilies/sadeyes.gif)