Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Difference between the queries
Message
De
09/05/2008 11:55:07
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Difference between the queries
Divers
Thread ID:
01316100
Message ID:
01316100
Vues:
53
Hi All,

I am running the following queries on MySQL database. However both are giving me different results. Could anyone please help me ?

Many thanks in advance,
Abhishek

Query 1: Gives me 208 records
select loadid from ( select loadid
	from dialer_lead_duplicates
	join pending_dialer_loads
	using(loadid)
	where brokerid in (1028)
	and date(datecreated)=date(20080508)
	group by requestid, year(datecreated), month(datecreated), day(datecreated), hour(datecreated)
) as tmp_table group by loadid
Query 2: Gives me 207 records
Select LoadId,BrokerId from
	(Select brokerId, LoadId from dialer_lead_duplicates
	join pending_dialer_loads
	using(loadid)
	where date(datecreated) = '2008-05-08'
	group by requestid, year(datecreated), month(datecreated), day(datecreated), hour(datecreated)
	) as tmp_table group by LoadId
	having brokerid = 1028
Répondre
Fil
Voir

Click here to load this message in the networking platform