Posts

Showing posts with the label distinct

distinct item for each date

distinct item for each date for each date, i have different items with unique ID, how to create a table to show each date with distinct item in each day? date |item | Trade ID 1 |A | 123 2 |A | 124 1 |A | 125 3 |B | 126 1 |A | 127 2 |A | 128 3 |C | 129 1 |A | 130 desired results date |item 1 |A 2 |A 3 |B 3 |C i tried the following code, but i got an error msg select date, distinct item from mytable it says found "distinct" expecting an identifier found a keyword thank you! Hint: SELECT DISTINCT . – Gordon Linoff Jul 1 at 23:29 SELECT DISTINCT Why is date 1 always combined with A? Is this a coincidence in your sample data? Can one date occur with two different items? If yes: what to do in this situation? If no: change your data model ...