By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,266 Members | 1,297 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,266 IT Pros & Developers. It's quick & easy.

Select more than one value for a field in a query

P: 1
pmc_sales1."documentno" AS documentno,
pmc_sales1."aj_date" AS date,
pmc_sales1."aj_ordno" AS ordno,
pmc_sales1."aj_total" AS total,
pmc_sales1."aj_tax" AS tax,
pmc_salesline."aj_servicetype" AS servicetype,
pmc_salesline."aj_totalprice" AS totalprice,
pmc_salesrep."aj_sname" AS sname,
pmc_customer1."name" AS cname,
pmc_customer1."aj_address1" AS address

"adempiere"."pmc_sales1" pmc_sales1
LEFT OUTER JOIN "adempiere"."pmc_salesline" pmc_salesline
ON pmc_salesline."aj_sorderno" = pmc_sales1."documentno"
LEFT OUTER JOIN "adempiere"."pmc_salesrep" pmc_salesrep
ON pmc_sales1."aj_sname" = pmc_salesrep."pmc_salesrep_id"
LEFT OUTER JOIN "adempiere"."pmc_customer1" pmc_customer1
ON pmc_sales1."aj_cname" = pmc_customer1."pmc_customer1_id"

pmc_salesline."aj_servicetype" AS servicetype will get more than one value
How to write query to consider all existing values for this particular field?
Thanks in advance
Oct 31 '08 #1
Share this Question
Share on Google+
1 Reply

code green
Expert 100+
P: 1,726
Not sure what you mean.
If you simply want to filter only a certain servicetype then you need a WHERE clause
Expand|Select|Wrap|Line Numbers
  1. WHERE pmc_salesline."aj_servicetype"  = 'somevalue'
If you want a range of servicetypes then
Expand|Select|Wrap|Line Numbers
  1. WHERE pmc_salesline."aj_servicetype" IN 
  2. ('somevalue1''somevalue2','somevaluen..')
But I am probably wide of the mark
Oct 31 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.