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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Concatenation

Status
Not open for further replies.

JohnnyRocket

Programmer
Joined
Dec 16, 2001
Messages
3
Location
CA
Hello,

I am writing a query that will determine how many times a given web page is accessed. Each page name is made up of two parts in the table: 1. Target and 2. Parameters. Not all targets have parameters and if there is no parameter the table has a "-" in the parameter column. I have written the following query but where there is a "-" in the parameter column I don't want the "-" to be displayed (i.e. I just want to diplay the target) Any ideas?

SELECT (Target+Parameters), count(*)
FROM LOGtable
GROUP BY (Target+Parameters);
 
Yes, you can use CASE..WHEN statement in select statement.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top