Re: Mysql Query Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi
I think this query will work for u.
Please test it and let me know.
Take care
Regards
Imran Rahi

--- Yuan Yudistira <sabukhitam@xxxxxxxxx> wrote:

> please help me with the following problems
> 
> I have two tables :
> 
> mysql> describe PAYMENT_TYPE;
>
+---------------------+--------------+------+-----+---------------------+----------------+
> | Field | Type | Null | Key | Default | Extra |
>
+---------------------+--------------+------+-----+---------------------+----------------+
> | PAYMENT_TYPE_ID | int(11) | | PRI | NULL |
> auto_increment |
> | PAYMENT_TYPE | varchar(100) | | | | |
> | INSERT_DATE | datetime | | | 0000-00-00 00:00:00 |
> |
>
+---------------------+--------------+------+-----+---------------------+----------------+
> 3 rows in set (0.00 sec)
> 
> Content of PAYMENT_TYPE IS :
> mysql> select * from JENIS_PEMBAYARAN;
>
+---------------------+------------------+---------------------+
> | PAYMENT_TYPE_ID | PAYMENY_TYPE | INSERT_DATE |
>
+---------------------+------------------+---------------------+
> | 1 | INK | 2005-08-04 18:16:18 |
> | 2 | KON | 2005-08-04 18:16:34 |
> | 3 | NP | 2005-08-04 18:17:10 |
> | 4 | TTPPLG | 2005-08-16 14:55:36 |
> | 5 | PROM | 2005-08-16 15:11:03 |
> | 6 | GTS | 2005-08-16 15:13:55 |
>
+---------------------+------------------+---------------------+
> 6 rows in set (0.00 sec)
> 
> mysql> describe CUSTOMER_ORDER
>  -> ;
>
+---------------------+------------+------+-----+---------+-------+
> | Field | Type | Null | Key | Default | Extra |
>
+---------------------+------------+------+-----+---------+-------+
> | CUSTOMER_ORDER_ID | int(11) | | PRI | 0 | |
> | EDISI_ID | int(11) | YES | MUL | NULL | |
> | CUSTOMER_ID | int(11) | YES | MUL | NULL | |
> | PAYMENT_TYPE_ID | int(11) | YES | MUL | NULL | |
> | EXEMPLAR | int(11) | YES | | NULL | |
> | DISKON | int(11) | | | 0 | |
> | IS_NOMINAL_DISKON | tinyint(1) | | | 0 | |
> | ORDER_STATUS | tinyint(1) | YES | | NULL | |
> | INSERTED_BY | int(11) | YES | MUL | NULL | |
> | INSERT_DATE | datetime | YES | | NULL | |
>
+---------------------+------------+------+-----+---------+-------+
> 
> How to create MySQL Query so I can get EXEMPLAR OF
> each CUSTOMER_ORDER_ID, 
> based on
> PAYEMENT_TYPE.
> 
> CUSTOMER_ID, INK, KON, NP, TTPLG, PROM, GTS
> 1 10 25 0 0 0 0 
> (customer with CUSTOMER_ID 1 
> order 10 EXEMPLAR PAYMENT TYPE= INK 
> 25 EXEMPLAR PAYMENT TYPE= KON, 
> 0 PAYMENT TYPE= NP, 
> 0 PAYMENT TYPE= TTPLG
> etc)
> 
> 
> thanks
> 
> YUAN
> 
> 
> [Non-text portions of this message have been
> removed]
> 
> 



		
__________________________________ 
Yahoo! Mail 
Stay connected, organized, and protected. Take the tour: 
http://tour.mail.yahoo.com/mailtour.html 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12h4p0vtb/M=362131.6882499.7825260.1510227/D=groups/S=1705006764:TM/Y=YAHOO/EXP=1124966489/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life - brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~-> 

PHP Data object relational mapping generator - http://www.meta-language.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux