Hey,

I am using Sequel to build a MySQL query with a join.

The query looks like that :
SELECT DISTINCT * FROM `users` INNER JOIN `subscriptions` ON
(`subscriptions`.`user_id` = `users`.`id`) WHERE
(`subscriptions`.`feed_id` = 34037)

Right now this returns the fields from users, but also from
subscriptions... and I don't want them; I just the ones from users:

SELECT DISTINCT users.* FROM `users` INNER JOIN `subscriptions` ON
(`subscriptions`.`user_id` = `users`.`id`) WHERE
(`subscriptions`.`feed_id` = 34211)"


The example show from DataSet::Select are very light :

dataset.select(:a) # SELECT a FROM items
  dataset.select(:a, :b) # SELECT a, b FROM items
  dataset.select{|o| o.a, o.sum(:b)} # SELECT a, sum(b) FROM items

Is there a way to select fields from a specific table only?

That would be great!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to