I have a table "A" that have many rows with fields linking tables "B" and "C"
this fields (called "A.b" and "A.c") are the rowids of tables "B" and "C" respectively.
Inside tables "B" and "C" there are fields called "date-b" and "date-c" respectively.
have that said...what I need is a list of "A.b" that mets the following conditions: "date-b" should be after an specific date, and "date-c" should be before an specific date...
Any help whopuld be really appreciated....
Many thanks in advance
thanks for this, i had been struggling all day to understand subqueries and given that mysql.com utterly useless this article helped me out alot. thank you.
Would you please correct an error #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '" + " ,mstr_customer cus" + " ,(' at line 1
on code :
SELECT pj.faktur,pj.tanggal,cus.nama,fk.bayar" +
" FROM ttrs_penjualan pj" +
" ,mstr_customer cus" +
" ,( SELECT sum( (prd.harga * pd.qty) - ((prd.harga * pd.qty) * (pd.diskon/100))) as bayar,pd.faktur" +
" FROM ttrs_penjualan_detail pd" +
" ,mstr_product prd" +
" WHERE pd.prd_id=prd.prd_id" +
" GROUP BY pd.faktur ) fk" +
" WHERE pj.faktur=fk.faktur" +
" AND pj.cust_id=cus.cust_id
Thanx anyway.
need some help with a queryAlejandro September 22, 2011 at 5:56 PM
I have a table "A" that have many rows with fields linking tables "B" and "C" this fields (called "A.b" and "A.c") are the rowids of tables "B" and "C" respectively. Inside tables "B" and "C" there are fields called "date-b" and "date-c" respectively. have that said...what I need is a list of "A.b" that mets the following conditions: "date-b" should be after an specific date, and "date-c" should be before an specific date... Any help whopuld be really appreciated.... Many thanks in advance
subqueriesPaul September 23, 2011 at 12:02 AM
thanks for this, i had been struggling all day to understand subqueries and given that mysql.com utterly useless this article helped me out alot. thank you.
queriesveni January 28, 2012 at 11:43 AM
nice
dbmsswapna March 22, 2012 at 3:43 PM
its very nice we can understand easily but to know the second max wt is the query is required ?
Subquery syntax errorAgus Wahyudi June 4, 2012 at 9:16 PM
Would you please correct an error #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '" + " ,mstr_customer cus" + " ,(' at line 1 on code : SELECT pj.faktur,pj.tanggal,cus.nama,fk.bayar" + " FROM ttrs_penjualan pj" + " ,mstr_customer cus" + " ,( SELECT sum( (prd.harga * pd.qty) - ((prd.harga * pd.qty) * (pd.diskon/100))) as bayar,pd.faktur" + " FROM ttrs_penjualan_detail pd" + " ,mstr_product prd" + " WHERE pd.prd_id=prd.prd_id" + " GROUP BY pd.faktur ) fk" + " WHERE pj.faktur=fk.faktur" + " AND pj.cust_id=cus.cust_id Thanx anyway.
SubquriesAjit June 23, 2012 at 11:10 AM
thank u?
Post your Comment