Click here to Skip to main content
15,906,816 members
Home / Discussions / Database
   

Database

 
QuestionSelecting records of last two days: Pin
Shahzad.Aslam20-Jul-07 21:43
Shahzad.Aslam20-Jul-07 21:43 
AnswerRe: Selecting records of last two days: Pin
Christian Graus20-Jul-07 21:47
protectorChristian Graus20-Jul-07 21:47 
AnswerRe: Selecting records of last two days: Pin
bablu_singh22-Jul-07 19:49
bablu_singh22-Jul-07 19:49 
Questionhelp for sql query plz Pin
amjad ali shah20-Jul-07 2:09
amjad ali shah20-Jul-07 2:09 
AnswerRe: help for sql query plz Pin
leckey20-Jul-07 4:13
leckey20-Jul-07 4:13 
AnswerRe: help for sql query plz Pin
andyharman20-Jul-07 4:19
professionalandyharman20-Jul-07 4:19 
GeneralRe: help for sql query plz Pin
Paul Conrad20-Jul-07 5:54
professionalPaul Conrad20-Jul-07 5:54 
AnswerRe: help for sql query plz Pin
DQNOK20-Jul-07 8:37
professionalDQNOK20-Jul-07 8:37 
I know this was urgent for you, but I didn't see you offer to pay for a solution, so I wasn't sure just how urgent it really was. Nevertheless, I did take a few minutes and try to read your select statement. I'm really blind about these things so I took the liberty of reformatting it a bit so I could see what was going on:
SELECT cust_order.order_id     AS order_id
     , customers.fname         AS fname
     , customers.lname         AS lname
     , cust_order.order_date   AS order_date
     , cust_order.order_status AS order_status
FROM   cust_order, customers 
WHERE  cust_order.customer_id=customers.customer_id 
    ?  cust_order.order_id    IN (SELECT DISTINCT order_id
                                  FROM cust_debit 
                                  WHERE amount>=2000) 
  AND  cust_order.customer_id=customers.customer_id 
  AND  cust_order.customer_id IN (SELECT DISTINCT customer_id 
                                  FROM cust_order
                                  WHERE order_id IN (SELECT DISTINCT order_id
                                                     FROM cust_debit 
                                                     WHERE amount>=2000)?;

Apart from putting in spaces, carriage returns, and changing case on a couple of reserved words, I've also placed two '?' marks where I don't understand the query. The first one SEEMS to have a missing operator. The next one SEEMS to have a missing ')'. You said you are running this query and getting results, so I guess I don't understand the dialect you are using. Would it be possible for you to re-write the intention of the query in a dialect I could understand, and re-post it? If so, I might be able to look at it a couple of minutes and POSSIBLY offer some suggestions.

David
Questiondata type mismatch when i try to insert data [modified] Pin
kudorgyozo20-Jul-07 1:10
kudorgyozo20-Jul-07 1:10 
AnswerRe: data type mismatch when i try to insert data Pin
Rob Graham21-Jul-07 4:13
Rob Graham21-Jul-07 4:13 
Questionquery + ms sql 2005 Pin
ritu432120-Jul-07 0:21
ritu432120-Jul-07 0:21 
AnswerRe: query + ms sql 2005 Pin
Pete O'Hanlon20-Jul-07 1:08
mvePete O'Hanlon20-Jul-07 1:08 
GeneralRe: query + ms sql 2005 Pin
ritu432120-Jul-07 1:28
ritu432120-Jul-07 1:28 
Questionhai insert query problem Pin
srinivassam19-Jul-07 22:27
srinivassam19-Jul-07 22:27 
AnswerRe: hai insert query problem Pin
Colin Angus Mackay19-Jul-07 22:48
Colin Angus Mackay19-Jul-07 22:48 
AnswerRe: hai insert query problem Pin
Paddy Boyd20-Jul-07 0:50
Paddy Boyd20-Jul-07 0:50 
QuestionFine-tune SP Pin
Joe19-Jul-07 21:56
Joe19-Jul-07 21:56 
AnswerRe: Fine-tune SP Pin
Colin Angus Mackay19-Jul-07 22:52
Colin Angus Mackay19-Jul-07 22:52 
Questionselect alst record was added Every minute Pin
Dr.PHP19-Jul-07 21:03
Dr.PHP19-Jul-07 21:03 
AnswerRe: select alst record was added Every minute Pin
Paul Conrad20-Jul-07 5:55
professionalPaul Conrad20-Jul-07 5:55 
GeneralRe: select alst record was added Every minute Pin
Dr.PHP20-Jul-07 19:24
Dr.PHP20-Jul-07 19:24 
GeneralRe: select alst record was added Every minute Pin
Paul Conrad21-Jul-07 4:56
professionalPaul Conrad21-Jul-07 4:56 
Questionvalue of variable Pin
harsh_c19-Jul-07 19:51
professionalharsh_c19-Jul-07 19:51 
AnswerRe: value of variable Pin
N a v a n e e t h19-Jul-07 22:43
N a v a n e e t h19-Jul-07 22:43 
GeneralRe: value of variable Pin
harsh_c19-Jul-07 23:57
professionalharsh_c19-Jul-07 23:57 

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.