• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 61
  • Last Modified:

Out the count variables

Hi all, I would like to get the out of the count...

Select * from tickets where event_ID=20

Output:

2x USD
3x SGD
5x AUD

I Don't want the count, I just want the output.

This is so I can do less queries on the page, relating to currency conversion
0
Graeme
Asked:
Graeme
  • 3
  • 2
1 Solution
 
Ryan ChongCommented:
what do you mean by
I Don't want the count, I just want the output.

?
can you elaborate more?
0
 
Graemewebber4technologiesAuthor Commented:
Hi Ryan, sorry the mobile app isnt as good as the PC

So the Query I currently have is:

Select * from tickets where event_ID=20

Open in new window


its output is:
USD
USD
SGD
AUD
AUD
SGD
SGD
AUD
AUD
AUD

I know if I do a count of these, its
2x USD
3x SGD
5x AUD

but I do not want the count (the numeric number)

I want the output (3 different types)
USD
SGD
AUD

hope this makes more sense
0
 
Ryan ChongCommented:
i'm not too sure if I understand you, but think you can use a Group By clause here?

like:
Select currencyfield
from tickets
where event_ID=20
group by currencyfield
order by by currencyfield

Open in new window

see if this is what you want?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Graemewebber4technologiesAuthor Commented:
Oh that might be the way, let me try it out, will get back to you soon

Cheers!
0
 
Graemewebber4technologiesAuthor Commented:
Perfect mate! cheers!
0
 
worthyking1Commented:
A much simpler way is to use the DISTINCT method, as follows:

Select DISTINCT CurrencyType from tickets where event_ID=20

Open in new window


* Obviously replace "CurrencyType" above with your actual column name. You can also add ORDER BY if needed to sort the results.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now