Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select

Status
Not open for further replies.

Johnny42

Technical User
Jul 13, 2004
127
CA
SELECT DISTINCT(item) CONCAT(item,' - ',itemno) FROM ICITEM

can this work ?
 
probably not

that's mysql, right? do you realize there is a forum for mysql? see forum436

DISTINCT is not a function

it is a keyword which ensures that only distinct rows are returned by the query

in your case, it will return one row for every distinct combination of item and itemno

rudy
SQL Consulting
 
using pervasive,

eg:
ID Description
a blah
a blah
c boy
d girl
s dog

result:

a - blah
c - boy
d - girl
s - dog
 
SELECT DISTINCT CONCAT(item,' - ',itemno) FROM ICITEM

Dieter
 
tried SELECT DISTINCT CONCAT(item,' - ',itemno) FROM ICITEM got this :

ODBC Error: SQLSTATE = 37000, Native error code = 0
Invalid parameter count for scalar function CONCAT.


 
You may try this :
SELECT DISTINCT item || ' - ' || itemno FROM ICITEM

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
according to the pervasive documentation (and this was the first time i've ever even looked into it), the CONACT function takes two arguments

so i would try

SELECT DISTINCT CONCAT(CONCAT(item,'-'),itemno) ...

rudy
SQL Consulting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top