Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 23/11/2024 Black Friday 2024

    BIG SALE, 30% discount for all our extensions. Use BF24 coupon code. Hurry up the discount is valid till 3 December.

  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Help needed to create query...
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Help needed to create query...
#50771
Help needed to create query... 10 Years, 3 Months ago Karma: 0
Hi. Help needed to create query

Example:

Table1:Main(M)
Code:


+--+-----+
|id|title|
+--+-----+
|1 |xxx  |
+--+-----+
|2 |yyy  |
+--+-----+



Table2:Other(O) (O.id_main=M.id)
Code:


+--+--------------+--------+------+
|id|id_main(=M.id)|id_field|value |   
+--+--------------+--------+------+
|1 |1             |1       |hhh   |
+--+--------------+--------+------+
|2 |1             |2       |ppp   |
+--+--------------+--------+------+
|3 |2             |1       | -    |
+--+--------------+--------+------+
|4 |2             |2       |nnn   |
+--+--------------+--------+------+




The desired result:
Code:


+----+-------+---------------------+---------------------+
|M.id|M.title|O.value(O.id_field=1)|O.value(O.id_field=2)|
+----+-------+---------------------+---------------------+
|1   |xxx    |hhh                  |ppp                  |
|2   |yyy    | -                   |nnn                  |
+----+-------+---------------------+---------------------+



O.id_field will be:(1-5)

Code:


SELECT M.id,title, O.value
FROM xxx_main M INNER JOIN xxx_other O
 ON M.id=O.id_main
.............? 

Help. Thank you.
Last Edit: 2014/08/11 21:51 By onuvidelsolnce.
The administrator has disabled public write access.
 
#50774
Re:Help needed to create query... 10 Years, 3 Months ago Karma: 760
Hello,

Send your order number by email please.

Regards,
ARI Soft
The administrator has disabled public write access.
 
Go to topPage: 1