Re: Mysql Query Help

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

 



Hey
Forgot to send u in last mail.
check this out and let me know back

SELECT pay.EXEMPLAR, pay.PAYMENT_TYPE,
ord.CUSTOMER_ORDER_ID
 FROM PAYMENT_TYPE pay, CUSTOMER_ORDER ord WHERE
pay.PAYMENT_TYPE_ID = cust.PAYMENT_TYPE_ID

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]
> 
> 



		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 


------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12h4u3b98/M=362335.6886445.7839731.1510227/D=groups/S=1705006764:TM/Y=YAHOO/EXP=1124980225/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/";>In low income neighborhoods, 84% do not own computers. At Network for Good, help bridge the Digital Divide!</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