mysql - number of rows in a stored procedure -


is possible conditional select based on number of rows in stored procedure?

e.g. if select * table1 has no records, select * table2?

try this:

select col1, col2, ..., coln table1 union select col1, col2, ..., coln table2 not exists (select * table1) 

this of course assumes both tables have same structure.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -