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?

use MySQL SET syntax to hide repeated cols output?
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: use MySQL SET syntax to hide repeated cols output?
#55938
use MySQL SET syntax to hide repeated cols output? 9 Years, 1 Month ago Karma: 0
I wish to hide the contents of some columns produced by a JOIN.
MySQL docs show that
SET @previous:="";

SELECT IF(summary=@previous, "", @previous:=summary), ...

does it fine in PHPMyAdmin;
result 1 IVFDF Ceilidh Spot Fri 27 Feb 15 RichardA
result 2 ----- title hidden ---- Fri 27 Feb 15 RichardA


but produces syntax error 1064 in ARI Datatables output, with or without the semi-colon

Can we do this SET in the SQL Query box and what would be syntax be please?
Thanks
Trevor
The administrator has disabled public write access.
 
#55939
Re:use MySQL SET syntax to hide repeated cols output? 9 Years, 1 Month ago Karma: 760
Hello,

Only one query can be defined in "SQL -> SQL query" parameter. SET and SELECT are two queries. You can create a store procedure and then call it into the module or use a query something like this:


SELECT
IF(summary=@previous, "", @previous:=summary)
FROM
tbl, (SELECT @previous:="") T


Regards,
ARI Soft
The administrator has disabled public write access.
 
#55940
Re:use MySQL SET syntax to hide repeated cols output? 9 Years, 1 Month ago Karma: 0
Hello, can you clarify 1. how to create a store procedure and
2. does that secondary query have to HAVE a real table called eg tbl;

my single query starts
SELECT IF(summary=@previous, "", @previous:=summary) AS title, ,,,, from 'various joins' etc -
I am trying to suppress the second and subsequent display of the same event title (and date etc)

if in PHPMyAdmin I perform the SET query, then the main query works ie gets it from a session variable?
Thanks
Trevor
The administrator has disabled public write access.
 
#55941
Re:use MySQL SET syntax to hide repeated cols output? 9 Years, 1 Month ago Karma: 760
You can read about stored procedures here.

Replace "tbl" with a name of table which contains "summary" column.

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