sql - MySQL union and order by help -


The code below works, but when I order order order by Sdid, then I get the error < / p>

Choose unknown column 'order clause' in 's.id'

  $ build = "child. subscribe name = child.parent INNER (s.productid = parent.id) select Join where s.username = '$ logged' and s.type = '0' child. .sid = child.sid subscribe INNER (s.productid = Parent.id) where s.username = '$ logged' and parent.keyword! = Child.name and s.type = '1' order s through Mr. Diissi ";   

How do I change the code so that it can be ordered by s.id, which is the ID of the table?

is by MySQL Union tried to implement ORDER but union within child < / Code> column (without child ). Prefix on it), there is no s.id in the union but you can add one:

  select the child. *, SID as SDID ... Selecting Union Hair * As SID SID ... SED ordered by Diissi   

You'll need to give it a nickname because union table will erase the name or nickname prefix. If the sid column has child , then use the other names for s.id .

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -