SQL Box

Moderator: crythias

Post Reply
mzydelis
Znuny newbie
Posts: 12
Joined: 11 May 2018, 15:12
Znuny Version: OTRS-6.06

SQL Box

Post by mzydelis »

Hello everyone,

I have run into a problem working with SQL Box. I do not manage to get exact table information, for example what I am trying to get is from a ticket information a distance traveled and time. I manage to find tables, but do not manage to open them. SHOW OPEN TABLES do not work.

Code: Select all

SELECT *
FROM dynamic_field
WHERE ID=68 OR ID=69
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: SQL Box

Post by reneeb »

Code: Select all

select * from dynamic_field_value where object_id = <ticket_id> where field_id in (68,69)
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
mzydelis
Znuny newbie
Posts: 12
Joined: 11 May 2018, 15:12
Znuny Version: OTRS-6.06

Re: SQL Box

Post by mzydelis »

Thank you reneeb!

One more thing, is it possible to connect it with person who created this ticket and driven all this distance and spent his time?
mzydelis
Znuny newbie
Posts: 12
Joined: 11 May 2018, 15:12
Znuny Version: OTRS-6.06

Re: SQL Box

Post by mzydelis »

If anyone is interested code is:

SELECT FIELD_ID, VALUE_TEXT, first_name, last_name
FROM dynamic_field_value, ticket, users
WHERE dynamic_field_value.field_id in (68,69) and ticket.id = OBJECT_ID and RESPONSIBLE_USER_ID = users.id
Post Reply