Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7628605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:37:16+00:00 2026-05-31T05:37:16+00:00

I have this MySQL query and the syntax is correct, but when I want

  • 0

I have this MySQL query and the syntax is correct, but when I want to see the view, the mysql process go to 100%.

CREATE OR REPLACE VIEW tx_oriconvenios_consultas AS
        SELECT conv.*, tipo.descripcion AS tipo_convenio, uni.nombre AS n_universidad, ciu.nombre AS n_ciudad, pais.cn_short_es AS n_pais, COUNT(hist.estado) AS n_estado
        FROM tx_unalori_convenio AS conv
        LEFT JOIN tx_unalori_historico as hist
        ON conv.uid = hist.convenio
        INNER JOIN tx_unalori_tipoconv as tipo
        ON conv.tipoconv = tipo.uid
        INNER JOIN tx_unalori_universidad as uni
        ON conv.universidad = uni.uid
        INNER JOIN tx_unalori_ciudad as ciu
        ON ciu.uid=uni.uid_ciudad
        INNER JOIN static_countries as pais
        ON pais.cn_iso_3 = ciu.pais
        GROUP BY conv.uid

If I remove:

INNER JOIN static_countries as pais
        ON pais.cn_iso_3 = ciu.pais

or:

 LEFT JOIN tx_unalori_historico as hist
    ON conv.uid = hist.convenio

Then I can enter to the view and see the registers.

I can’t understand why.

I really apreciate some explanation.


For those who asked, this is the structure of static_countries:

CREATE TABLE IF NOT EXISTS `static_countries` (
  `uid` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `pid` int(11) unsigned DEFAULT '0',
  `deleted` tinyint(4) NOT NULL DEFAULT '0',
  `cn_iso_2` char(2) DEFAULT '',
  `cn_iso_3` char(3) DEFAULT '',
  `cn_iso_nr` int(11) unsigned DEFAULT '0',
  `cn_parent_tr_iso_nr` int(11) unsigned DEFAULT '0',
  `cn_official_name_local` varchar(128) DEFAULT '',
  `cn_official_name_en` varchar(128) DEFAULT '',
  `cn_capital` varchar(45) DEFAULT '',
  `cn_tldomain` char(2) DEFAULT '',
  `cn_currency_iso_3` char(3) DEFAULT '',
  `cn_currency_iso_nr` int(10) unsigned DEFAULT '0',
  `cn_phone` int(10) unsigned DEFAULT '0',
  `cn_eu_member` tinyint(3) unsigned DEFAULT '0',
  `cn_address_format` tinyint(3) unsigned DEFAULT '0',
  `cn_zone_flag` tinyint(4) DEFAULT '0',
  `cn_short_local` varchar(70) DEFAULT '',
  `cn_short_en` varchar(50) DEFAULT '',
  `cn_uno_member` tinyint(3) unsigned DEFAULT '0',
  `cn_short_es` varchar(50) NOT NULL DEFAULT '',
  PRIMARY KEY (`uid`),
  UNIQUE KEY `uid` (`uid`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=250 ;

And this of the tx_unalori_historico:

CREATE TABLE IF NOT EXISTS `tx_unalori_historico` (
  `uid` int(11) NOT NULL AUTO_INCREMENT,
  `pid` int(11) NOT NULL DEFAULT '0',
  `tstamp` int(11) NOT NULL DEFAULT '0',
  `crdate` int(11) NOT NULL DEFAULT '0',
  `cruser_id` int(11) NOT NULL DEFAULT '0',
  `deleted` tinyint(4) NOT NULL DEFAULT '0',
  `hidden` tinyint(4) NOT NULL DEFAULT '0',
  `be_users` int(11) NOT NULL DEFAULT '0',
  `convenio` int(11) NOT NULL DEFAULT '0',
  `estado` int(11) NOT NULL DEFAULT '0',
  `observaciones` text NOT NULL,
  PRIMARY KEY (`uid`),
  KEY `parent` (`pid`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3810 ;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:37:17+00:00Added an answer on May 31, 2026 at 5:37 am

    Thanks @ypercube.

    The problem was solved adding index keys to static_countries.cn_iso_3 and tx_unalori_ciudad.pais

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a feeling I am completely borking this MySQL query but I'll ask
I have this mysql query using PHP and first part is working fine, but
I have some problem converting a MYSQL query to CI syntax. This my MySQL
I have a question about my mysql query syntax When i use this $result
I have this MySQL query, and it works on a MySQL database, but not
I have a query like this (Mysql 5.X, PHP - formatted for legibility) $query
I have this query which works correctly in MySQL. More background on it here
I have a MySQL query like this: SELECT *, SUM(...some SQL removed for brevety)
I have a MySQL query like this: SELECT DAYNAME(CreatedAt) AS TheDay, SUM(Amount) AS TheSum
Background: I have this with rollup query defined in MySQL: SELECT case TRIM(company) when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.