Hi guys, I have a dataset that returns rows that look like the following
field | value
--
1 | 7
1 | 7
2 | 4
8 | 90
Is it possible to remove the duplicate (1 | 7) row directly within a LIST
control (or similar?)? I cannot use a DISTINCT directly in the SQL as
elsewhere I need to display the duplicate row.
Thanks for any help
TazSilly me, thats what grouping is for lol.
Thanks anyways
Taz
Showing posts with label distinct. Show all posts
Showing posts with label distinct. Show all posts
Monday, March 12, 2012
Wednesday, March 7, 2012
possible SQL query for this function?
i am trying to write an SQL query for an Access database. in this database i have a table with inventory data. what i want is to select distinct item numbers and sum up all of the inventory quantity for those item numbers. i know how to select distinct item numbers OK from this table, but how can i go through the table and sum the quantities for those item numbers and dump all the results into a new table? that would mean for each distinct item number, there would be one resulting sum for that item. so the table would be 2 columns, one with distinct item numbers and one with their sums. thanks for any help!GROUP BY
-PatP|||Since it is F-F-F-Friday and I'm seeing out the last 30 mins...
SELECT MyDisinctCol, Sum(QuantityCol) AS TheTotal
FROM MyTable
GROUP BY MyDisinctCol
Another 20 secs gone!|||that did it! thanks for the help...
-PatP|||Since it is F-F-F-Friday and I'm seeing out the last 30 mins...
SELECT MyDisinctCol, Sum(QuantityCol) AS TheTotal
FROM MyTable
GROUP BY MyDisinctCol
Another 20 secs gone!|||that did it! thanks for the help...
Subscribe to:
Posts (Atom)