Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Difference between the queries
Message
From
09/05/2008 11:55:07
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Difference between the queries
Miscellaneous
Thread ID:
01316100
Message ID:
01316100
Views:
51
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
Reply
Map
View

Click here to load this message in the networking platform