Click here to Skip to main content
15,898,371 members
Home / Discussions / Database
   

Database

 
AnswerRe: please Pin
Richard MacCutchan21-Oct-23 21:14
mveRichard MacCutchan21-Oct-23 21:14 
AnswerRe: please Pin
jschell23-Oct-23 5:25
jschell23-Oct-23 5:25 
AnswerRe: please Pin
Gerry Schmitz24-Oct-23 7:15
mveGerry Schmitz24-Oct-23 7:15 
AnswerRe: please Pin
CHill6029-Oct-23 23:44
mveCHill6029-Oct-23 23:44 
QuestionGetting Last Record and First Record from a Record Set (SQL server DB) Pin
Member 1184335621-Sep-23 8:07
Member 1184335621-Sep-23 8:07 
AnswerRe: Getting Last Record and First Record from a Record Set (SQL server DB) Pin
Richard Andrew x6421-Sep-23 8:58
professionalRichard Andrew x6421-Sep-23 8:58 
GeneralRe: Getting Last Record and First Record from a Record Set (SQL server DB) Pin
Member 1184335621-Sep-23 9:18
Member 1184335621-Sep-23 9:18 
GeneralRe: Getting Last Record and First Record from a Record Set (SQL server DB) Pin
Gerry Schmitz21-Sep-23 14:02
mveGerry Schmitz21-Sep-23 14:02 
Questionprior action plan to prevent sql database corruption Pin
Kar_Malay1-Sep-23 20:01
Kar_Malay1-Sep-23 20:01 
AnswerRe: prior action plan to prevent sql database corruption Pin
Richard Andrew x642-Sep-23 2:38
professionalRichard Andrew x642-Sep-23 2:38 
GeneralRe: prior action plan to prevent sql database corruption Pin
Dave Kreskowiak2-Sep-23 3:33
mveDave Kreskowiak2-Sep-23 3:33 
AnswerRe: prior action plan to prevent sql database corruption Pin
jschell4-Sep-23 5:42
jschell4-Sep-23 5:42 
GeneralRe: prior action plan to prevent sql database corruption Pin
Kar_Malay2-Oct-23 9:22
Kar_Malay2-Oct-23 9:22 
QuestionFetch row and display in frontend column Pin
Kesiena26-Aug-23 3:14
Kesiena26-Aug-23 3:14 
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 

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.