Click here to Skip to main content
15,886,919 members
Home / Discussions / Database
   

Database

 
AnswerRe: Fetch row and display in frontend column Pin
David Mujica28-Aug-23 3:16
David Mujica28-Aug-23 3:16 
AnswerRe: Fetch row and display in frontend column Pin
jschell29-Aug-23 5:01
jschell29-Aug-23 5:01 
AnswerRe: Fetch row and display in frontend column Pin
Rohan Saadat17-Nov-23 5:10
Rohan Saadat17-Nov-23 5:10 
QuestionMulti-user use the database at the same time Pin
Siavash.BRY11-Aug-23 23:49
Siavash.BRY11-Aug-23 23:49 
AnswerRe: Multi-user use the database at the same time Pin
Richard Deeming13-Aug-23 21:18
mveRichard Deeming13-Aug-23 21:18 
AnswerRe: Multi-user use the database at the same time Pin
Dave Kreskowiak14-Aug-23 5:12
mveDave Kreskowiak14-Aug-23 5:12 
AnswerRe: Multi-user use the database at the same time Pin
jschell14-Aug-23 6:37
jschell14-Aug-23 6:37 
QuestionTough one Pin
Richard Andrew x6431-Jul-23 4:59
professionalRichard Andrew x6431-Jul-23 4:59 
I can't figure out the following:

I have order header and detail tables with UPC codes and the order numbers they belong to. There can be many different UPC codes for each order. The Order IDs are in the header table and the UPC codes are in the detail table.

I must find UPC codes that have been used for more than one order, in other words, where the same UPC code exists for two or more distinct orders.

I have tried:

SELECT OD.UPC, OH.OrderId, COUNT(DISTINCT OH.OrderId) [COUNT]
FROM OrderDetail OD
LEFT JOIN OrderHeader OH ON OH.OrderHeaderId = OD.OrderHeaderId
GROUP BY OD.UPC, OH.OrderId
HAVING COUNT(DISTINCT OH.OrderId) > 1
But this query returns nothing and I'm not sure if it's because there are no duplicate orders or because the query is wrong.

Any help will be tremendously appreciated. Thank you.



The difficult we do right away...
...the impossible takes slightly longer.


modified 31-Jul-23 11:18am.

AnswerRe: Tough one Pin
Richard Deeming31-Jul-23 5:33
mveRichard Deeming31-Jul-23 5:33 
GeneralRe: Tough one Pin
Richard Andrew x6431-Jul-23 5:35
professionalRichard Andrew x6431-Jul-23 5:35 
QuestionWhy do some websites provide Demo for their premium html themes while the codes can be seen using inspection tool in chrome? Pin
Alex Dunlop11-Jul-23 6:30
Alex Dunlop11-Jul-23 6:30 
AnswerRe: Why do some websites provide Demo for their premium html themes while the codes can be seen using inspection tool in chrome? Pin
PIEBALDconsult11-Jul-23 6:01
mvePIEBALDconsult11-Jul-23 6:01 
QuestionORDER BY in UNION Pin
_Flaviu29-May-23 5:14
_Flaviu29-May-23 5:14 
AnswerRe: ORDER BY in UNION Pin
jschell29-May-23 6:15
jschell29-May-23 6:15 
GeneralRe: ORDER BY in UNION Pin
_Flaviu29-May-23 7:54
_Flaviu29-May-23 7:54 
AnswerRe: ORDER BY in UNION Pin
Richard Deeming29-May-23 21:37
mveRichard Deeming29-May-23 21:37 
AnswerRe: ORDER BY in UNION Pin
Richard Andrew x6431-May-23 2:41
professionalRichard Andrew x6431-May-23 2:41 
GeneralRe: ORDER BY in UNION Pin
_Flaviu13-Jun-23 8:28
_Flaviu13-Jun-23 8:28 
AnswerRe: ORDER BY in UNION Pin
Richard Andrew x6413-Jun-23 13:19
professionalRichard Andrew x6413-Jun-23 13:19 
GeneralRe: ORDER BY in UNION Pin
_Flaviu14-Jun-23 9:29
_Flaviu14-Jun-23 9:29 
GeneralRe: ORDER BY in UNION Pin
Richard Andrew x6414-Jun-23 13:00
professionalRichard Andrew x6414-Jun-23 13:00 
AnswerHow about a Temp table Pin
David Mujica6-Jun-23 3:40
David Mujica6-Jun-23 3:40 
GeneralRe: How about a Temp table Pin
jschell6-Jun-23 4:59
jschell6-Jun-23 4:59 
GeneralRe: How about a Temp table Pin
k50546-Jun-23 5:24
mvek50546-Jun-23 5:24 
GeneralRe: How about a Temp table Pin
jschell7-Jun-23 5:09
jschell7-Jun-23 5:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.