473,394 Members | 1,642 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Select more than one value for a field in a query

1
SELECT
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

FROM
"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"


Here
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
1 1629
code green
1,726 Expert 1GB
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

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

Similar topics

5
by: Mark | last post by:
Hi - I have set-up security for my users - the security is held in a text field, separated by a comma. If the users a member of groups 1, 5 and 6 - the usergroups field is set to 1,5,6 - to...
2
by: phpuser32423 | last post by:
Hi everyone Is it by any chance possible to use mysql and php to auto create the content for drop-down lists on forms by retrieving the values from a database? The reason i ask is that on a site...
14
by: Jos? | last post by:
This one droves me completely mad. I did not succeed to exploit the track given to me by Bob. I have : three tables : Clubs, Persons and ClubsPersons that join the two first in a many to many...
4
by: LD | last post by:
Is there a way in Access to store more than one value in a field that has been selected from a combo box? For example, if a combo box had three values that you can select, "One", "Two", and...
6
by: jjturon | last post by:
Can anyone help me?? I am trying to pass a Select Query variable to a table using Dlookup and return the value to same select query but to another field. Ex. SalesManID ...
3
by: otac0n | last post by:
How can I select the maximum value from a field, but make sure that the value i want stays greater than a cetrain value? I currently have this: SELECT A.rating, B.rating,...
22
by: MP | last post by:
vb6,ado,mdb,win2k i pass the sql string to the .Execute method on the open connection to Table_Name(const) db table fwiw (the connection opened via class wrapper:) msConnString = "Data Source="...
6
by: simon.harris | last post by:
I have a query in an Access2000 db (created using the QBE as it happens!) that the resulting SQL looks like this; SELECT CLIENTS., Logfile., Logfile., SASTESTS.Cost, SASTESTS.*CLIENTS. AS...
2
by: fperri | last post by:
Hello, I have a query that creates a table of duplicates in my database. For one set of duplicates (three records), all the fields & values are the same except for the values in one field. This...
17
by: trose178 | last post by:
Good day all, I am working on a multi-select list box for a standard question checklist database and I am running into a syntax error in the code that I cannot seem to correct. I will also note...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.